I am trying to use pyenv to install Python2.7. It fails, it seems, due to inabilities to download a compatible version of pip. I have already downgraded to pip version 20.3.4, but can't figure out how to tell pyenv this:
pyenv install 2.7.7
Installing openssl-1.0.2k...
Installed openssl-1.0.2k to /Users/username/.pyenv/versions/2.7.7
python-build: use readline from homebrew
Installing Python-2.7.7...
patching file ./Lib/site.py
patching file ./Lib/ssl.py
patching file ./Modules/_ssl.c
python-build: use tcl-tk from homebrew
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
WARNING: The Python sqlite3 extension was not compiled. Missing the SQLite3 lib?
Installing pip from https://bootstrap.pypa.io/pip/2.7/get-pip.py...
error: failed to install pip via get-pip.py
BUILD FAILED (OS X 12.6.2 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/xl/3b9jpy1x5sq6gr7b_qzw1pkm0000gn/T/python-build.20221225200507.60628
Results logged to /var/folders/xl/3b9jpy1x5sq6gr7b_qzw1pkm0000gn/T/python-build.20221225200507.60628.log
Last 10 log lines:
WARNING: Certificate did not match expected hostname: pypi.org. Certificate: {'notAfter': 'Aug 27 18:45:09 2023 GMT', 'subjectAltName': (('DNS', 'www.python.org'), ('DNS', '*.python.org'), ('DNS', 'docs.python.org'), ('DNS', 'downloads.python.org'), ('DNS', 'pypi.python.org')), 'subject': ((('commonName', u'www.python.org'),),)}
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(CertificateError("hostname 'pypi.org' doesn't match either of 'www.python.org', '*.python.org', 'docs.python.org', 'downloads.python.org', 'pypi.python.org'",),)': /simple/pip/
/var/folders/xl/3b9jpy1x5sq6gr7b_qzw1pkm0000gn/T/tmpiEoxv0/pip.zip/pip/_vendor/urllib3/util/ssl_.py:164: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
WARNING: Certificate did not match expected hostname: pypi.org. Certificate: {'notAfter': 'Aug 27 18:45:09 2023 GMT', 'subjectAltName': (('DNS', 'www.python.org'), ('DNS', '*.python.org'), ('DNS', 'docs.python.org'), ('DNS', 'downloads.python.org'), ('DNS', 'pypi.python.org')), 'subject': ((('commonName', u'www.python.org'),),)}
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(CertificateError("hostname 'pypi.org' doesn't match either of 'www.python.org', '*.python.org', 'docs.python.org', 'downloads.python.org', 'pypi.python.org'",),)': /simple/pip/
/var/folders/xl/3b9jpy1x5sq6gr7b_qzw1pkm0000gn/T/tmpiEoxv0/pip.zip/pip/_vendor/urllib3/util/ssl_.py:164: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
WARNING: Certificate did not match expected hostname: pypi.org. Certificate: {'notAfter': 'Aug 27 18:45:09 2023 GMT', 'subjectAltName': (('DNS', 'www.python.org'), ('DNS', '*.python.org'), ('DNS', 'docs.python.org'), ('DNS', 'downloads.python.org'), ('DNS', 'pypi.python.org')), 'subject': ((('commonName', u'www.python.org'),),)}
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(CertificateError("hostname 'pypi.org' doesn't match either of 'www.python.org', '*.python.org', 'docs.python.org', 'downloads.python.org', 'pypi.python.org'",),)) - skipping
ERROR: Could not find a version that satisfies the requirement pip<21.0 (from versions: none)
ERROR: No matching distribution found for pip<21.0
I'm on Mac 12.6