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.
Edit:
Result of type -a python3 python3.8
, python3
, import ssl
python3 is /usr/local/bin/python3
python3 is /usr/bin/python3
python3 is /bin/python3
python3.8 is /usr/local/bin/python3.8
python3.8 is /usr/bin/python3.8
python3.8 is /bin/python3.8
#@#:/usr/local/lib$ python3
Python 3.8.6 (default, Nov 19 2020, 14:27:22)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.8/ssl.py", line 98, in <module>
import _ssl # if we can't import it, let the error propagate
ModuleNotFoundError: No module named '_ssl'