RequestsDependencyWarning: urllib3 (1.25.2) or chardet (3.0.4) doesn't match a supported version! Fix
Asked Answered
N

8

181

Whenever I run my code with requests or do a pip install I get this message

/usr/lib/python2.7/site-packages/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.25.2) or chardet (3.0.4) doesn't match a supported version!
  RequestsDependencyWarning)

I have tried upgrading chardet, urllib3 and requests but nothing is working, anyone know how can I fix this?

Edit: RequestsDependencyWarning: urllib3 (1.9.1) or chardet (2.3.0) doesn't match a supported version <-- This did not fix my problem.

Nelidanelie answered 15/5, 2019 at 18:29 Comment(3)
Possible duplicate of RequestsDependencyWarning: urllib3 (1.9.1) or chardet (2.3.0) doesn't match a supported versionSmocking
stackoverflow.com/…Smocking
"(link to seeming duplicate) This did not fix my problem." -- can you provide more details as to why it's not a dupe? Did you try all 21 answers from that thread? If so, please describe how they didn't work specifically (what error/result/behavior did you experience). Absent any follow-up, I vote to close this as a dupe. Thanks.Shuttle
W
289

The proper command for fixing this is:

pip3 install --upgrade requests

I upgraded from 2.21.0 to 2.24.0 and the error went away.

Winterfeed answered 29/9, 2020 at 5:36 Comment(0)
D
65

Simply you have to install latest version of requests

  pip3 install requests
Dabble answered 16/5, 2019 at 14:5 Comment(3)
"you have to upgrade you requests". But this command does not upgrade the request module.Spelter
^ nor does upgrading even do anything, jfcMelodee
This does not work if the module was already installed.Spelter
C
22

I fixed this problem with

pip install --upgrade requests==2.20.1

If you see version incompatible message like following, you should try other versions. All versions are: here

ERROR: docker-compose 1.24.1 has requirement requests!=2.11.0,!=2.12.2,!=2.18.0,<2.21,>=2.6.1, but you'll have requests 2.21.0 which is incompatible.
Chamfron answered 5/10, 2019 at 17:38 Comment(3)
No need to specify versions unless you need to.Lewislewisite
Use either --upgrade either ==2.20.1; it does not make sense to use both at the same time.Dement
this worked for me , the more advanced version 2-27.1 was apparently incompatibleUncalledfor
P
5

I got this problem when I tried to run docker-compose: urllib3 (1.24.1) or chardet (3.0.4) doesn't match a supported version

In my case I solved by remove the docker-compose:

sudo apt-get remove docker-compose

and installing:

sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

Edit: Now it should contain v on specifying its version.

sudo curl -L "https://github.com/docker/compose/releases/download/v2.20.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

Then run:

sudo chmod +x /usr/local/bin/docker-compose

Polythene answered 5/7, 2019 at 12:42 Comment(0)
W
4

Find this and look in requests/init.py source file:

def check_compatibility(urllib3_version, chardet_version):
    urllib3_version = urllib3_version.split('.')
    assert urllib3_version != ['dev']  # Verify urllib3 isn't installed from git.

    # Sometimes, urllib3 only reports its version as 16.1.
    if len(urllib3_version) == 2:
        urllib3_version.append('0')

        # Check urllib3 for compatibility.
        major, minor, patch = urllib3_version  # noqa: F811
        major, minor, patch = int(major), int(minor), int(patch)
        # urllib3 >= 1.21.1, <= 1.24    !HERE!
        assert major == 1
        assert minor >= 21
        assert minor <= 24

        # Check chardet for compatibility.
        major, minor, patch = chardet_version.split('.')[:3]
        major, minor, patch = int(major), int(minor), int(patch)
        # chardet >= 3.0.2, < 3.1.0    !HERE!
        assert major == 3
        assert minor < 1
        assert patch >= 2
Wafture answered 13/2, 2021 at 19:35 Comment(0)
A
2

In my case upgrading requests didn't work. pip3 install requests

I used ehh's solution of downloading docker-compose again

sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/bin/docker-compose

Then adding execution capability to the file by sudo chmod +x /usr/bin/docker-compose

Anasarca answered 7/6, 2020 at 2:21 Comment(0)
I
0

I got the same problem and fixed this problem with the command

pip install --upgrade requests==2.20.1

Interlace answered 17/5, 2023 at 2:56 Comment(2)
It's a copy of this answer from 2019.Chrysler
Please don't repeat existing answers. Once you have sufficient reputation, you will be able to vote up questions and answers that you found helpful. - From ReviewChrysler
A
0

this is worked for me pip3 install --upgrade requests

Allergen answered 14/4, 2024 at 2:11 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.