使用pip3安装软件包时,“ Python中的SSL模块不可用”

我已经在本地计算机上成功安装了Python 3.4和Python 3.6,但是无法使用安装软件包pip3。


执行时pip3 install <package>,出现以下与SSL相关的错误:


pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

Collecting <package>

  Could not fetch URL https://pypi.python.org/simple/<package>/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping

  Could not find a version that satisfies the requirement <package> (from versions: )

No matching distribution found for <package>

如何修复Python3.x安装,以便可以使用安装软件包pip install <package>?


陪伴而非守候
浏览 1746回答 3
3回答

HUWWW

我遇到了与主题描述相同的问题。环境:MacOS Sierra。我用自制的。我的解决方案:通过brew uninstall openssl, brew install openssl; 重新安装openssl ;根据Homebrew提供的提示,执行以下操作:echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profileexport LDFLAGS="-L/usr/local/opt/openssl/lib"export CPPFLAGS="-I/usr/local/opt/openssl/include"
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python