【问题标题】:pip3 can't install anything due to some reason about ssl由于 ssl 的某些原因,pip3 无法安装任何东西
【发布时间】: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


【解决方案1】:

也许你可以下载一个.whl 文件并用 pip3 安装它

wheel文件可以找到here

然后就用这个来安装

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

希望这能解决您的问题

干杯!

【讨论】:

  • 非常感谢!我相信它会有所帮助,但我已经使用 wget 和 pip3 半小时来处理依赖问题。我已经手动安装了bleach、enum34、numpy、protobuf、6、Werkzeug、wheel等,但是tensorflow-gpu仍然需要额外的包。而且我不知道我是否可以在 2 多个小时内完成该过程,因为 tensorflow-gpu 依赖于太多的包。那么有没有一种方法可以更方便地处理这个过程呢?谢谢!
  • 您在 Windows 或 Linux 上运行什么系统?
  • 我的服务器是 Ubuntu 16.04。
  • 看看这个网站并尝试从头开始安装它here
  • 只需根据您的要求更改版本号。我有设置脚本来帮助朋友,但目前找不到,
猜你喜欢
  • 2017-12-18
  • 2021-05-30
  • 1970-01-01
  • 1970-01-01
  • 2013-06-29
  • 2018-09-20
  • 2021-02-08
  • 1970-01-01
  • 2019-02-28
相关资源
最近更新 更多