Domanda

I am getting odd errors that OpenSSL package has some problems. Earlier I insntalled PyCharm IDE that is built on pyenv environment, it may have somehow broken my OpenSSL. I have tried to install OpenSSL again with brew install openssl but errors such as the below persist.

How to install OpenSSL in Mac OSX Mojave 10.14.6?

pip3 install numpy
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Requirement already satisfied: numpy in /usr/local/lib/python3.7/site-packages (1.16.2)
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
È stato utile?

Soluzione

The SSL module is ordinarily a part of the python installation itself. The fact that you haven't got it doesn't mean that anything is wrong with your OpenSSL package or anything like that - rather it is python's own SSL module that is missing.

You can usually fix this by reinstalling python with this command from the Terminal:

brew reinstall python

The fact that you mention OpenSSL seems to indicate that you have received some messages about OpenSSL or in other ways that you haven't really told the full story in the few lines of output in your question. If this is the case, it could be that you're trying to recompile something that needs OpenSSL. In that case, you'll need to install the development files (headers) for OpenSSL using this command:

brew install openssl

Afterwards you can use stuff like the python installation manager to upgrade python like this:

pythonz install 3.8.2 --configure="--with-openssl=$(brew --prefix openssl)"
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a apple.stackexchange
scroll top