Skip to main content

When running python openai command, I was greeted with

/usr/lib/python3/dist-packages/requests/__init__.py:89: RequestsDependencyWarning: urllib3 (1.25.8) or chardet (5.2.0) doesn't match a supported version!

This is because of different requests module installed by the OS and the python dependencies for your local installation.

Package                 Version
----------------------- --------------------
chardet                 5.2.0
urllib3                 1.25.8

Usually this issue can be solved by upgrading requests:

pip install requests

or

pip3 install requests

Either of these actions had nil impact on the to packages.

Another option is to uninstall them and re-mstall

pip uninstall urllib3    
pip uninstall chardet
pip install requests 

Response

pip uninstall urllib3
Found existing installation: urllib3 1.25.8
Not uninstalling urllib3 at /usr/lib/python3/dist-packages, outside environment /usr
Can't uninstall 'urllib3'. No files were found to uninstall.
pip uninstall chardet
Found existing installation: chardet 3.0.4
Not uninstalling chardet at /usr/lib/python3/dist-packages, outside environment /usr
Can't uninstall 'chardet'. No files were found to uninstall.
pip install requests
Requirement already satisfied: requests in /home/{user}/.local/lib/python3.8/site-packages (2.31.0)
Requirement already satisfied: charset-normalizer<4,>=2 in /home/{user}/.local/lib/python3.8/site-packages (from requests) (3.3.0)
Requirement already satisfied: certifi>=2017.4.17 in /home/{user}/.local/lib/python3.8/site-packages (from requests) (2023.7.22)
Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/lib/python3/dist-packages (from requests) (1.25.8)
Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3/dist-packages (from requests) (2.8)

 

Updated package versions

Package                 Version
----------------------- --------------------
chardet                 3.0.4
urllib3                 1.25.8

 

Related articles

Andrew Fletcher29 Feb 2024
Python - OSError: [Errno 24] Too many open files
The "Too many open files" error in Python typically occurs when your program has opened more file descriptors than the operating system allows. This error is often seen in situations where files are not being properly closed after use, leading to the exhaustion of available file...
Andrew Fletcher17 Feb 2024
How to update installed Python packages
You can use the pip list --outdated command to view a list of installed Python packages that have newer versions available. This command will show you which packages are outdated and can be updated to the latest versions.Here's how you can use itpip list --outdatedThis command will display a list of...