I'm encountering a problem when installing packages on Python 2.7 using pip. Despite repeated attempts, the installation fails with SSL errors and warnings about an insecure platform. For example here's the error output I received while trying to install python -m pip install scipy:
Collecting scipy
SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform...
InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately...
SSLError: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /simple/scipy/ (Caused by SSLError('_ssl.c:499: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol'))
I'm using Python 2.7, installed with pyenv-win on a Windows machine. I understand that these warnings indicate an issue with SSL support in Python 2.7, and upgrading Python could resolve the issue. However, I'm constrained to use Python 2.7 for this specific project.
Here's what I've tried so far:
- Upgrading pip to the latest version for Python 2.7. using this small PowerShell script I developed.
- Installing other packages to see if the issue is isolated to SciPy, but similar SSL errors occur.
Can anyone explain why these SSL errors are happening and how to resolve them without upgrading to a newer Python version?
Any help or insights would be greatly appreciated!