我已经成功地在本地计算机上安装了Python3.4和Python3.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>安装软件包
发布于 2018-02-28 17:02:18
如果您在OSX上并且已经从源代码编译了python:
使用brew brew install openssl安装openssl
确保遵循brew提供的关于设置CPPFLAGS和LDFLAGS的说明。在我的例子中,我使用的是openssl@1.1 brew公式,我需要为python过程设置以下3种设置,以正确链接到我的SSL库:
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig"假设库安装在该位置。
https://stackoverflow.com/questions/41328451
复制相似问题