[PYTHON] Read this if you get SSL related errors with pip install! !! !!

environment

mac OS Catalina python 3.6.5

Status

I left python for a while (about a year), but when I tried to install a new package pip install <package name>, I got this error ...

WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting numpy-stl (package name you tried to install this time)
  WARNING: Retrying (Retry(total=4, 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/numpy-stl/
  WARNING: Retrying (Retry(total=3, 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/numpy-stl/
  WARNING: Retrying (Retry(total=2, 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/numpy-stl/
  WARNING: Retrying (Retry(total=1, 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/numpy-stl/
  WARNING: 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/numpy-stl/
  Could not fetch URL https://pypi.org/simple/numpy-stl/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/numpy-stl/ (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 numpy-stl (from versions: none)
ERROR: No matching distribution found for numpy-stl
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

After investigating various things, as a solution --pip update --Add an option to trust the host when pip install --curl update --Create pip.conf I tried all of them because there were various things, but ** none of them worked. ** (Reference) Quite despair at this point. .. ..

Solution

After all, I solved it by raising the version of python and changing my mind with pip. (You may need to update Xcode's Command Line Tool on the way.) I was using pyenv, so

pyenv install 3.8.1
pyenv global 3.8.1
pip install (Packages you want to install)

The installation was completed successfully! !! !!

If you are desperate for the same problem, I would be happy if this could solve it. I hope you like it! !! please!

Recommended Posts

Read this if you get SSL related errors with pip install! !! !!
SSL certificate related with pip install? Error
What to do if you get a UnicodeDecodeError with pip install
Workaround if you get an error when trying to install PySide with pip
If you get hooked on pip install dlib on OSX
What to do if you can't install pyaudio with pip #Python
[TensorFlow] If you want to run TensorBoard, install it with pip
I got an SSL related error with pip install, so I solved it
What to do if you can't install with pip in babun environment
What to do if you get Could not fetch URL 443 with pip
If you get lost with HTTP redirects 301 and 302
What to do if you can't pip install mysqlclient
Error with pip install
Dealing with pip and related installation errors on Ubuntu 18.04
Until you install TensorFlow-GPU with pip in Windows environment
Install scikit.learn with pip
What to do if you get an Undefined error when trying to use pip with pyenv
Until you can install your own Python library with pip
Can't find the package you installed with pip install --user?
I have libncurses but get angry with pip install readline
EC2 / Amazon Linux2: What to do if you get an "unable to execute'gcc': No such file or directory" error with pip install
When moss with pip install
I get an error when trying to install maec 4.0.1.0 with pip
If you get angry with "too few updates ~" when running LdaModel
Tensorflow with Raspberry Pi. If you stumble with pip, solve it with virtualenv!
If you should have pip installed but get an Import error
Install Python 2.7.9 and Python 3.4.x with pip.
module install if pip install doesn't work
Manipulate colors with pip install color
Uninstall everything you installed with pip
Solution if pip gives [SSL: CERTIFICATE_VERIFY_FAILED]
How to install mysql-connector with pip3
[Python Windows] pip install with Python version
What to do if you get lost in file reference with FileNotFoundError
If you want to get multiple statistics with groupby in pandas v1
Measures that pip install cannot be done with pycharm or import ssl cannot be done