ValueError: not enough values to unpack (expected 3, got 1)

When using requests, I've just upgraded and I'm having the following error:
`import requests as rq`

`File "C:\Users\_HOME_\AppData\Local\Programs\Python\Python36\lib\site-packages\requests\__init__.py", line 53, in <module>`


`major, minor, patch= urllib3_version`


`ValueError: not enough values to unpack (expected 3, got 1)`

can you give me the output of `pip freeze`?

I would like to know the answer to this, but the solution to this problem should be:

    $ pip install --upgrade requests

```
appdirs==1.4.3
beautifulsoup4==4.6.0
cachetools==2.0.0
certifi==2017.4.17
cffi==1.10.0
chardet==3.0.3
click==6.7
colorclass==2.2.0
decorator==4.0.11
docopt==0.6.2
enum-compat==0.0.2
enum34==1.1.6
eventlet==0.21.0
first==2.0.1
future==0.16.0
gmusicapi==10.1.2
gnp==0.0.4
google-assistant-sdk==0.3.1
google-auth==1.0.1
google-auth-oauthlib==0.1.0
google-search==1.0.2
googleapis-common-protos==1.5.2
gpsoauth==0.4.1
greenlet==0.4.12
grpcio==1.3.5
html5lib==0.999999999
httplib2==0.10.3
idna==2.5
interruptingcow==0.6
isodate==0.5.4
lxml==3.7.3
MechanicalSoup==0.7.0
mock==2.0.0
mutagen==1.37
oauth2client==4.1.0
oauthlib==2.0.2
packaging==16.8
pafy==0.5.3.1
pbr==3.0.1
pip-tools==1.9.0
pip-upgrader==1.4.0
proboscis==1.2.6.0
protobuf==3.3.0
py-GSearch-API==1.31
py-web-search==0.2.4
pyasn1==0.2.3
pyasn1-modules==0.0.8
pycparser==2.17
pycryptodomex==3.4.6
pydub==0.19.0
PyMySQL==0.7.11
pyparsing==2.2.0
python-dateutil==2.6.0
python-telegram-bot==6.0.1
pytz==2017.2
requests==2.14.1
requests-oauthlib==0.8.0
rsa==3.4.2
schedule==0.4.2
six==1.10.0
sounddevice==0.3.7
stevedore==1.21.0
telegram==0.0.1
terminaltables==3.1.0
ujson==1.35
Unidecode==0.4.20
urllib3==1.21.1
validictory==1.1.1
virtualenv==15.1.0
virtualenv-clone==0.2.6
virtualenvwrapper==4.7.2
webencodings==0.5.1
youtube-dl==2017.5.26
```

I have just downgraded requests and it's working (it fails with requests 2.16.1)

can you try `$ pip install --upgrade requests`?

```C:\Users\HOME\PycharmProjects\NewsBot>pip install --upgrade requests
Collecting requests
  Downloading requests-2.16.2-py2.py3-none-any.whl (86kB)
    100% |████████████████████████████████| 92kB 566kB/s
Requirement already up-to-date: idna<2.6,>=2.5 in c:\users\javier alonso silva\appdata\local\programs\python\python36\lib\site-packages (from requests)
Requirement already up-to-date: certifi>=2017.4.17 in c:\users\javier alonso silva\appdata\local\programs\python\python36\lib\site-packages (from requests)
Requirement already up-to-date: urllib3<1.22,>=1.21.1 in c:\users\javier alonso silva\appdata\local\programs\python\python36\lib\site-packages (from requests)
Requirement already up-to-date: chardet<3.1.0,>=3.0.2 in c:\users\javier alonso silva\appdata\local\programs\python\python36\lib\site-packages (from requests)
Installing collected packages: requests
  Found existing installation: requests 2.14.1
    Uninstalling requests-2.14.1:
      Successfully uninstalled requests-2.14.1
Successfully installed requests-2.16.2_

_C:\Users\HOME\PycharmProjects\NewsBot>python bot.py
Traceback (most recent call last):
  File "bot.py", line 6, in <module>
    import functions.start_handler as st
  File "C:\Users\HOME\PycharmProjects\NewsBot\functions\start_handler.py", line 3, in <module>
    import functions.look_for_news as lfn
  File "C:\Users\HOME\PycharmProjects\NewsBot\functions\look_for_news.py", line 4, in <module>
    import gsearch
  File "C:\Users\HOME\AppData\Local\Programs\Python\Python36\lib\site-packages\gsearch\__init__._py", line 1, in <module>
    from gsearch.gsearch import search
  File "C:\Users\HOME\AppData\Local\Programs\Python\Python36\lib\site-packages\gsearch\gsearch.py", line 2, in <module>
    import requests as rq
  File "C:\Users\HOME\AppData\Local\Programs\Python\Python36\lib\site-packages\requests\__init__._py", line 53, in <module>
    major, minor, patch= urllib3_version
ValueError: not enough values to unpack (expected 3, got 1)
```

Nope, it's not working...

can you run the following code for me?

```pycon
>>> import urllib3
>>> urllib3.__version__
```

and tell me what that string is?

`Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit (AMD64)] on win32`
`Type "help", "copyright", "credits" or "license" for more information.`
`>>> import urllib3`
`>>> urllib3.__version__`
`'1.21.1'`
`exit()`

well, i can confidently say i cannot reproduce. 

Don't mind :)
requests 2.14.1 is working fine for me
Maybe is because Windows

shouldn't be. i have a windows machine i can test against though, just in case.

Do you, by chance, have a file in your project called `urllib3.py`?

well, thanks for opening this issue. very strange behavior. 

I'm going to close this for now, and see if any one else runs into this. if it's a problem, i'm sure it'll come up rather quickly. 

I was talking to more people and seem to be the same problem with `urllib3`

This issue happens if you have development (git) version of urllib3 installed.
```
>>> import urllib3
>>> print urllib3.__version__.split('.')
['dev']
>>> print urllib3.__version__
dev
```

Maybe add a check for "dev" and assume it's 1.21.1 or higher?

Want to send a pull request?

After thinking about it - now I don't think that adding a hack for "dev" urllib3 version is goog idea,  
if urllib3 api changes it could lead to problems in requests, those (like me) who use git stuff shouldn't have problem hacking version string in urllib3/__init__.py .  
Sorry for the noise.

Hi, having the same error, it just won't work on heroku

latest version of urllib3 -  `1.2.1` 

```
2017-06-08T12:17:41.764078+00:00 app[process.1]: import requests
2017-06-08T12:17:41.764079+00:00 app[process.1]: File "/app/.heroku/python/lib/python2.7/site-packages/requests/init.py", line 53, in 
2017-06-08T12:17:41.764116+00:00 app[process.1]: major, minor, patch = urllib3_version
2017-06-08T12:17:41.764149+00:00 app[process.1]: ValueError: need more than 1 value to unpack
```

Requests library

```
~ $ pip install --upgrade requests
Requirement already up-to-date: requests in ./.heroku/python/lib/python2.7/site-packages
Requirement already up-to-date: chardet<3.1.0,>=3.0.2 in ./.heroku/python/lib/python2.7/site-packages (from requests)
Requirement already up-to-date: certifi>=2017.4.17 in ./.heroku/python/lib/python2.7/site-packages (from requests)
Requirement already up-to-date: urllib3<1.22,>=1.21.1 in ./.heroku/python/lib/python2.7/site-packages (from requests)
Requirement already up-to-date: idna<2.6,>=2.5 in ./.heroku/python/lib/python2.7/site-packages (from requests)

```


Please upgrade your Requests.

@Lukasa done, please see edited comment

oh wow :(  This is the exact same error output i have, can't `import requests`

What does your requirements file look like? How are you getting urllib3?

Wasn't this an issue with the version in urllib3 being the string "dev"? Are you installing urllib3 from git or a distribution repository?

@nateprewitt @Lukasa the version in urllib3 is the string "1.2.1" but i've narrowed down replicating the problem in my case,

i'm using python-telegram-bot -> `pip install python-telegram-bot`
urllib3 & requests are installed with pip


**This is where the issue is replicated**

```
from telegram.ext import Updater
import requests
```

```
2017-06-08T14:39:18.555808+00:00 app[process.1]:   File "test_app.py", line 6, in <module>
2017-06-08T14:39:18.555847+00:00 app[process.1]:     import requests
2017-06-08T14:39:18.555871+00:00 app[process.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/requests/__init__.py", line 53, in <module>
2017-06-08T14:39:18.555916+00:00 app[process.1]:     major, minor, patch = urllib3_version
2017-06-08T14:39:18.556018+00:00 app[process.1]: ValueError: need more than 1 value to unpack
```


Sorry, to clarify, but `urllib3.__version__` is the string "1.2.1"?

@lukasa yes, that's correct

Well, apropos of nothing, but that will not work: Requests does not support urllib3 v1.2.1. However, that raises a very real question about what's going on. Can you run under pdb and use it to work out what the value of `urllib3_version` is at the time of the exception?

@lukasa the `urllib3_version` variable has the value `['dev']` in this case

@Samuel1123 Ok, so that doesn't entirely square with your position that `urllib3.__version__` is "1.2.1". This sounds like you are testing in a different environment to the one that you're hitting the problem in. Regardless, that makes this a duplicate of this bug: right now Requests does not support having a urllib3 installed directly from the master branch on GitHub.

@Lukasa 
When i do 
```
import requests
print urllib3.__version__
```

it is 1.2.1

@Samuel1123 Those two lines of code aren't going to execute. They will throw a `NameError`.

`pip install requests --upgrade`

Sorry @Lukasa 
```
import requests.packages.urllib3 as urllib3
urllib3.__version__
```
outputs - `1.2.1`