在升级我的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版本不匹配。我该怎么做?任何建议都将不胜感激!谢谢!
python -c“import ssl”
验证Python的ssl模块。 - phd