Weird SSL Errors with Python PIP
If you have been working with Python for a while, chances are you are very familiar with its package installer "pip".. I have been off it for quite some time having been working with the Anaconda (and Miniconda) binaries of Python.
Today, I was running some old code that required libraries that were not on the conda channels. I ran into some SSL problems.. The error seems generic enough to get confused as to whether the problem is with Python itself, or its SSL dependency.
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
After several retries the error eventually returns you back to the command prompt. No library installs will succeed!
To paint a better picture, below is a screenshot of the error.. And, I am working on my development environment, with the company issued workhorse, running Windows 10.
The last change I did was to upgrade pip itself. How I wish I did not do it.
If you encountered the same error, you're running Windows, and you're stumped on what to do.. Worry no more. This error is not entirely due to Python, but more on a missing or incompatible OpenSSL DLL.
The trouble with OpenSSL is that the binaries offered in its website are all for the Linux distributions. However this website has some binaries for the Windows platform. And they are kind enough to share them for download.
Simply download the executable and install on your computer and the error will go away. Likewise, I urge you to donate to them if this has helped you in any way.
If you missed my latest tip on Python dictionaries, check it out. There is also a compilation of Python online training courses that I often update.