Issue with macOS 10.11+ and OpenSSL
If you build Python on macOS 10.11+ using pythonz and try to pip install something, you will get the following error:
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
The cause, from the Python Developer's Guide:
As of OS X 10.11, Apple no longer provides header files for the deprecated system version of OpenSSL which means that you will not be able to build the _ssl extension. One solution is to install these libraries from a third-party package manager, like Homebrew or MacPorts, and then add the appropriate paths for the header and library files to your configure command. For example, with Homebrew:
To use Homebrew, for example, you can do the following:
$ brew install openssl xz $ CPPFLAGS="-I$(brew --prefix openssl)/include" \ LDFLAGS="-L$(brew --prefix openssl)/lib" \ pythonz install 3.6.0
Not sure where/how you'd want to document that so I'm just creating an issue. :)
Thanks. This saved my day.
Had a similar issue after using OSX's migration assistant, thanks for writing up your findings.
Was getting errors:
Could not fetch URL https://pypi.org/simple/virtualenv/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/virtualenv/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
Could not find a version that satisfies the requirement virtualenv (from versions: )
No matching distribution found for virtualenv
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
When trying to install $ pip3 install virtualenv after running the migration assistant.
pythonz install supports --configure option, see https://github.com/saghul/pythonz/issues/135#issuecomment-401560726