I'm a python engineer and I'm a beginner, and I'll share what I'm having trouble with.
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
What to do when an error such as
I don't know the root cause at all, so for the time being, I searched for words that I saw for the first time, such as error sentences and ssl. There seem to be various solutions.
-environment- macOS 10.14.6 python 3.6.6 venv (virtual environment)
Perhaps pip / python is referencing the old openssl (1.0.2s)? As far as I can see from the information, the questioner's openssl is the latest version, so I think that a reference error has occurred.
Check if ssl can be used below.
py
import ssl
python
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/[username]/.pyenv/versions/3.7.0/lib/python3.7/ssl.py", line 98, in <module>
import _ssl # if we can't import it, let the error propagate
ImportError: dlopen(/Users/[username]/.pyenv/versions/3.7.0/lib/python3.7/lib-dynload/_ssl.cpython-37m-darwin.so, 2): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
Referenced from: /Users/LO/.pyenv/versions/3.7.0/lib/python3.7/lib-dynload/_ssl.cpython-37m-darwin.so
Reason: image not found
I got an error
sh
$ brew switch openssl 1.0.2s
Read this if you get SSL related errors with pip install! !! !!
Only this.
ssl wasn't switched.
When I solved it, the cause was simple and easy to understand.
There may be some interpretations of my own, but I hope it helps.
Recommended Posts