pip3 can’t install for Python3.8 due to certificate errors

  linux, pip, python, python-3.x

Let me preface by saying, this question has come up a lot on Stack Overflow. I’ve read a number of those answers and tried many of the solutions, none of which have solved my issue. But first, here is the problem:

Some things I’ve tried (not exhaustive):

pip3 install --trusted-host pypi.org --trusted-host files.pythonhosted.org <package_name>
python3 -m pip install <package_name>
pip3 install <package name>

More or less the same error every time:

Defaulting to user installation because normal site-packages is not writeable
Could not fetch URL https://pypi.org/simple/venv/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/venv/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
ERROR: Could not find a version that satisfies the requirement venv (from versions: none)
ERROR: No matching distribution found for venv
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping

I’m running this on WSL2 Ubuntu 20.04.
I appreciate any thoughts or suggestions. I’ve also completely reinstalled python, tried different versions of python, reinstalled pip, tried different versions of pip, and a number of other things.

Source: Python-3x Questions

LEAVE A COMMENT