Python

解决 ‘Could not fetch URL https://

2018-05-30  本文已影响0人  devttao

python pip 安装出现pypi 源找不到的问题,是因为pypi 更改了官方网址

Could not fetch URL https://pypi.python.org/simple/pyopenssl/:

There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) - skipping
Could not find a version that satisfies the requirement pyopenssl (from versions: )
No matching distribution found for pyopenssl

参看官方说明:https://packaging.python.org/guides/migrating-to-pypi-org/
Uploads through pypi.python.org were switched off on July 3, 2017. As of April 13th, 2018,pypi.org is the URL for PyPI.

解决方案---重新安装pip:

(venv) -M-G22Y:s $ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1603k  100 1603k    0     0  1946k      0 --:--:-- --:--:-- --:--:-- 1946k

(venv) -M-G22Y: $ python get-pip.py 
Collecting pip
  Downloading https://files.pythonhosted.org/packages/0f/74/ecd13431bcc456ed390b44c8a6e917c1820365cbebcb6a8974d1cd045ab4/pip-10.0.1-py2.py3-none-any.whl (1.3MB)
    100% |################################| 1.3MB 1.0MB/s 
Installing collected packages: pip
  Found existing installation: pip 9.0.1
    Uninstalling pip-9.0.1:
      Successfully uninstalled pip-9.0.1
Successfully installed pip-10.0.1

再次安装 (venv) -M-G22Y:Jenkins_Jobs $ pip install pyopenssl 即可成功!

上一篇下一篇

猜你喜欢

热点阅读