{"id":999,"hash":"aaf2d33e9c7d8a9fa6010ad35677db80230bb07d43c23d4214d220e34889cd62","pattern":"Python (pip) - RequestsDependencyWarning: urllib3 (1.9.1) or chardet (2.3.0) doesn&#39;t match a supported version","full_message":"I found several pages about this issue but none of them solved my problem.\n\nEven if I do a :\n\npip show\n\nI get :\n\n/usr/local/lib/python2.7/dist-packages/requests/__init__.py:80: RequestsDependencyWarning: urllib3 (1.9.1) or chardet (2.3.0) doesn't match a supported version!\n  RequestsDependencyWarning)\nTraceback (most recent call last):\n  File \"/usr/bin/pip\", line 9, in <module>\n    load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()\n  File \"/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py\", line 480, in load_entry_point\n    return get_distribution(dist).load_entry_point(group, name)\n  File \"/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py\", line 2691, in load_entry_point\n    return ep.load()\n  File \"/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py\", line 2322, in load\n    return self.resolve()\n  File \"/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py\", line 2328, in resolve\n    module = __import__(self.module_name, fromlist=['__name__'], level=0)\n  File \"/usr/lib/python2.7/dist-packages/pip/__init__.py\", line 74, in <module>\n    from pip.vcs import git, mercurial, subversion, bazaar  # noqa\n  File \"/usr/lib/python2.7/dist-packages/pip/vcs/mercurial.py\", line 9, in <module>\n    from pip.download import path_to_url\n  File \"/usr/lib/python2.7/dist-packages/pip/download.py\", line 22, in <module>\n    import requests, six\n  File \"/usr/local/lib/python2.7/dist-packages/requests/__init__.py\", line 90, in <module>\n    from urllib3.exceptions import DependencyWarning\nImportError: cannot import name DependencyWarning\n\nWhat I did :\n\npip install --upgrade chardet\n\nbut as explain up, it gaves me the same error.\n\nso I did :\n\nsudo apt remove python-chardet\n\nand unistalling all his dependecies.\nAfter I reinstall it -> the same :'(\n\nI did the same for python-pip. After reinstalling it -> the same. \n\nHere are the lines about urllib3 and chardet versions needed :\nextract of /usr/local/lib/python2.7/dist-packages/requests/__init__.py :\n\n    # Check urllib3 for compatibility.\n    major, minor, patch = urllib3_version  # noqa: F811\n    major, minor, patch = int(major), int(minor), int(patch)\n    # urllib3 >= 1.21.1, <= 1.22\n    assert major == 1\n    assert minor >= 21\n    assert minor <= 22\n\n    # Check chardet for compatibility.\n    major, minor, patch = chardet_version.split('.')[:3]\n    major, minor, patch = int(major), int(minor), int(patch)\n    # chardet >= 3.0.2, < 3.1.0\n    assert major == 3\n    assert minor < 1\n    assert patch >= 2\n\n# Check imported dependencies for compatibility.\ntry:\n    check_compatibility(urllib3.__version__, chardet.__version__)\nexcept (AssertionError, ValueError):\n    warnings.warn(\"urllib3 ({0}) or chardet ({1}) doesn't match a supported \"\n                  \"version!\".format(urllib3.__version__, chardet.__version__),\n                  RequestsDependencyWarning)\n\nMy versions are :\n\nii  python-urllib3 1.9.1-3   all HTTP library with thread-safe connection pooling for Python \nii  python-chardet  2.3.0-1  all universal character encoding detector for Python2\n\nI don't have no more ideas...","ecosystem":"pypi","package_name":"pip","package_version":null,"solution":"You do have a mixed setup (both apt and pip were used to install system-wide, which is common), and it indeed doesn't match the supported versions of modules required by requests (and pip v1.5.6 is also quite old).\n\nThe requests (which version? likely leftover from pip install) requires:\n\nurllib3: 1.21.1 - 1.22\n\nchardet: 3.0.2 - 3.1.0  \n\nYou have:\n\nurllib3 (1.9.1) from python-urllib3 1.9.1-3 debian package\n\nchardet (2.3.0) from python-chardet 2.3.0-1 debian package  \n\nTwo options:  \n\neither downgrade requests to the version from your OS distribution (see what's available with apt show python-requests), or older versions at pypi.org, or  \n\nor install newer urllib3 and chardet (you can download the wheel files manually from pipy.org and do pip install on them, including any dependencies), either at user level (--user pip install option) or in a virtualenv.\n\nYou can test everything in a virtualenv (apt show python-virtualenv). It should even deploy a newer pip for you inside of its virtual envs. It is also possible to install a newer pip 10.0.1 at the user-level (--user) alongside your OS-vendored pip but you need to be careful about that. Good luck!","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/50202238/python-pip-requestsdependencywarning-urllib3-1-9-1-or-chardet-2-3-0-doe","votes":117,"created_at":"2026-04-19T04:52:09.113421+00:00","updated_at":"2026-04-19T04:52:09.113421+00:00"}