【问题标题】:Could not fetch URL https://pypi.python.org/simple/xlrd/ [duplicate]无法获取 URL https://pypi.python.org/simple/xlrd/ [重复]
【发布时间】:2019-03-22 19:51:37
【问题描述】:

当我尝试在我的 cmd 中运行此命令 pip install xlrd 时出现此错误。我使用了具有提升权限的 cmd 但仍然无济于事。请帮忙。非常感谢。

整个错误:

C:\Users\Rodne>pip install xlrd
Collecting xlrd
  Could not fetch URL https://pypi.python.org/simple/xlrd/: There was a problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749) - skipping
  Could not find a version that satisfies the requirement xlrd (from versions: )
No matching distribution found for xlrd
You are using pip version 9.0.1, however version 18.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

我有 python 3.6

我尝试升级,结果出来了:

C:\WINDOWS\system32>pip install pip setuptools --upgrade
Could not fetch URL https://pypi.python.org/simple/pip/: There was a problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749) - skipping
Requirement already up-to-date: pip in c:\users\rodne\appdata\local\programs\python\python36\lib\site-packages
Could not fetch URL https://pypi.python.org/simple/setuptools/: There was a problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749) - skipping
Requirement already up-to-date: setuptools in c:\users\rodne\appdata\local\programs\python\python36\lib\site-packages
You are using pip version 9.0.1, however version 18.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

使用受信任的安装给了我这个:

C:\WINDOWS\system32>pip install --trusted-host pypi.python.org xlrd
Collecting xlrd
  Could not fetch URL https://pypi.python.org/simple/xlrd/: There was a problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749) - skipping
  Could not find a version that satisfies the requirement xlrd (from versions: )
No matching distribution found for xlrd
You are using pip version 9.0.1, however version 18.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

【问题讨论】:

    标签: python


    【解决方案1】:

    您可以设置pypi.python.orgpypi.orgfiles.pythonhosted.org 受信任的主机来绕过 SSL 证书验证问题:

    pip install --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org xlrd
    

    【讨论】:

    • install --upgrade也使用上述命令pip:所有三个受信任主机条目。
    猜你喜欢
    • 2014-07-03
    • 2013-03-08
    • 1970-01-01
    • 1970-01-01
    • 2014-02-13
    • 2019-09-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多