【发布时间】:2018-04-26 05:03:44
【问题描述】:
升级我的 ubuntu 服务器 16.04 后,我无法为我的 python3.6 安装带有 pip3 的模块。这是我尝试为 python3 安装 tensorflow-gpu 时得到的结果:
root@amax:~# pip3 install tensorflow-gpu
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting tensorflow-gpu
Could not fetch URL https://pypi.python.org/simple/tensorflow-gpu/: 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 tensorflow-gpu (from versions: )
No matching distribution found for tensorflow-gpu
这是我的 python3 和 pip3 版本:
root@amax:~# python3 -V
Python 3.6.1
root@amax:~# which python3
/usr/local/bin/python3
root@amax:~# pip3 -V
pip 9.0.1 from /usr/local/lib/python3.6/site-packages (python 3.6)
我确定我的服务器上安装了 openssl:
root@amax:~# apt -y install openssl libssl-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libssl-dev is already the newest version (1.0.2g-1ubuntu13).
openssl is already the newest version (1.0.2g-1ubuntu13).
我认为问题的原因可能是我的 pip3 版本与 openssl 版本不匹配。我该怎么办?任何建议将不胜感激!谢谢!
【问题讨论】:
-
我已经尝试了页面中的所有解决方案,但都没有帮助。
-
您必须在安装 SSL 库后重新安装 python,因为 Python 的 ssl 模块将根据库的存在而安装(或不安装)。使用
python -c "import ssl"验证 Python 的 ssl 模块。
标签: python ubuntu ssl openssl pip