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 Fletcher13 Feb 2025
Deploying a Python project from UAT to production using Git
When deploying a Python project from a User Acceptance Testing (UAT) environment to Production, it’s essential to ensure that all dependencies and configurations remain consistent. Particularly in our situation where this was going to be the first deployment of AI semantic search functionality to...