由于ssl

时间:2017-11-13 13:36:32

标签: python ubuntu ssl openssl pip

升级我的ubuntu服务器16.04之后,我无法使用pip3为我的python3.6安装模块。这是我在尝试为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版本不匹配。我该怎么办?任何建议将不胜感激!谢谢!

1 个答案:

答案 0 :(得分:2)

您可以下载.whl文件并使用pip3

进行安装

可以找到车轮文件here

然后只使用它来安装

pip3 install /home/Downloads/tensorflow-1.4.0-cp36-cp36m-manylinux1_x86_64.whl

希望这能解决你的问题

干杯!