9

I am getting a warning that doesn't seem to be covered in any other online resource. I have Anaconda Python 3.6 installed. The warning I get when I create a new Conda environment is:

RequestsDependencyWarning: urllib3 (1.22) or chardet (2.3.0) doesn't match a supported version!
  RequestsDependencyWarning)

I thought it was a pip issue because of a possibly related question (not sure if it actually is: How to fix urllib3 RuntimeError: Requests dependency 'urllib3' must be version >= 1.21.1, < 1.22?). But I get the same issue:

 $ conda update pip
/Users/VincentLa/anaconda3/lib/python3.6/site-packages/requests/__init__.py:80: RequestsDependencyWarning: urllib3 (1.22) or chardet (2.3.0) doesn't match a supported version!
  RequestsDependencyWarning)
Vincent
  • 7,808
  • 13
  • 49
  • 63

5 Answers5

15
pip install --upgrade chardet

may help.

Tedo Vrbanec
  • 519
  • 6
  • 12
11

The only combination that helped me was (taken from http://blog.51cto.com/binuu/1948043):

pip uninstall urllib3    
pip uninstall chardet
pip install requests

All other ones were unable to update chardet, as "it was already updated" (it appears, that info was taken for that lib in another location).

evgeny9
  • 1,381
  • 3
  • 17
  • 31
3

I had this same issue.

The cause is from your python instance being confused about multiple libraries with different versions in different locations.

This Ubuntu scenario that i had will also yield your error.

a) Ubuntu Python libraries installed via sudo apt-get install python3-requests will download source to /usr/lib/python*/dist-packages

b) Ubuntu Python libraries installed via sudo -H pip3 install requests will download source to /usr/local/lib/python*/dist-packages

c) OS PATH & PYTHON_PATH point to /usr/lib:/usr/local/lib

d) You get a runtime warning because of python's library selection precedence. It therefore warns you that your current library in /usr/local/lib is incompatible with the dependancy located in the parent os library location /usr/lib

For your specific scenario, it seems you are using MacOS which has - python installed out of the box, and a custom python installation via anaconda.

To prevent conflict i recommend you remove the os python path /usr/lib/python when starting anaconda's python instance.

This will make sure it only uses anaconda's python libraries only, and not from your os.

  • Can you outline the steps to remove the os python path /usr/lib/python when starting anaconda's python instance? – Jash Shah Feb 21 '18 at 06:52
1

What worked for me:

pip uninstall requests
pip install requests
pip uninstall docopt # maybe would not be installed.
pip install docopt # install it nonetheless.
Jash Shah
  • 2,064
  • 4
  • 23
  • 41
1

The following code worked for me:

pip install --upgrade requests
Tox
  • 834
  • 2
  • 12
  • 33