Solution for MacOS Catalina (10.15.2), python pip causes OpenSSL error in environment updated from old OS

TL;DR Make / Library / Developer / CommandLineTools something like CommandLineTools.bak mv and do xcode-select --install.

Why do so

It seems that the Command Line Tools that were included before upgrading to Catalina are mistakenly recognized as new even though they are old. So even if you do xcode-select --install, you will be told ʻalready installed`. To force it back in.

There are various correction methods written, but none of them was relevant

The following was irrelevant.

Problem error string

$ pip install --upgrade pip
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
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 avai
lable.")': /simple/pip/
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 avai
lable.")': /simple/pip/
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 avai
lable.")': /simple/pip/
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 avai
lable.")': /simple/pip/
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 avai
lable.")': /simple/pip/
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 ur
l: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
Requirement already up-to-date: pip in /usr/local/lib/python3.7/site-packages (18.1)
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 ur
l: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping

Is brew bad or MacOS bad ...

It seems easier to do it on Cloud Shell (GCP). I can cry.

Recommended Posts

Solution for MacOS Catalina (10.15.2), python pip causes OpenSSL error in environment updated from old OS
Solution for pip install error [Python] [Mac]
Python development environment for macOS using venv 2016
Solution for run-time error in OpenVINO IEPlugin.load ()
Introduced sip-4.14 in python3.2.2 environment with MacOS 10.7.4
[Note] The solution for Python on MacOSX where import hashlib causes an error
CERTIFICATE_VERIFY_FAILED in Python 3.6, the official installer for macOS
"Temporary solution" when pip cannot be updated [Python]
Use Python in your environment from Win Automation
Install Python and libraries for Python on MacOS Catalina