我已经在我的本地机器上成功安装了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。pip install <package>?


当前回答

我在OSX 10.11上遇到了类似的问题,因为在3.6之上安装了python 3.7的memcached。

警告:pip配置了需要TLS/SSL的位置,但是Python中的SSL模块不可用。

花了几个小时解链接openssl,重新安装,改变路径。但一切都无济于事。将openssl版本从旧版本更改为旧版本,做到了这一点:

brew switch openssl 1.0.2e

我在网上没有看到这个建议。希望它能为某人服务。

其他回答

如果在窗户和使用蟒蛇,比我先解决它,

conda activate
pip install <lib>

这对我很管用。

我可以通过更新这个文件中的python版本来修复这个问题。 pyenv: version ' 3.6.5'未安装(由/Users/taruntarun/.python-version设置) 虽然我安装了最新版本,但我的命令仍然使用旧版本3.6.5

转到3.7.3版本

降级openssl对我有用,

brew switch openssl 1.0.2s

如果你在Windows上使用anaconda,这对我来说是有效的:

我尝试了很多其他的解决方案,但没有工作(环境路径变量变化…)

该问题可能是由其他软件放置在Windows\System32文件夹中的dll(例如libcrypto-1_1-x64.dll或libssl-1_1-x64.dll或其他)引起的。

修复方法是从https://slproweb.com/products/Win32OpenSSL.html安装openSSL,它将dll替换为最新版本。

这个问题可能是库丢失造成的。

在安装python 3.6之前,请确保安装了python所需的所有库。

$ sudo apt-get install build-essential checkinstall 
$ sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev

更多信息请参见如何在Ubuntu和LinuxMint上安装Python 3.6.0