1

我正在尝试在 Windows 10 Enterprise 上开始使用 Python 3.6,但每当我尝试使用 pip 安装必要的软件包时,我总是会遇到类似的 SSL 错误。

pip install requests 给出以下错误:

Collecting requests
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)'),)': /simple/requests/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)'),)': /simple/requests/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)'),)': /simple/requests/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)'),)': /simple/requests/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)'),)': /simple/requests/
  Could not fetch URL https://pypi.python.org/simple/requests/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /simple/requests/ (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)'),)) - skipping
  Could not find a version that satisfies the requirement requests (from versions: )
No matching distribution found for requests

对于我尝试安装的所有 pip 包,我得到了类似的“重试”模式和失败错误。我尝试做“easy_install bioservices”,我得到了:

...

Installed c:\users\...\python\python36-32\lib\site-packages\requests_cache-0.4.13-py3.6.egg
error: The 'requests' distribution was not found and is required by bioservices

然后尝试做 pip install bioservices 给了我:

已满足要求:c:\users...\python\python36-32\lib\site-packages\bioservices-1.5.2-py3.6.egg 中的 bioservices 收集 grequests(来自 bioservices)重试(重试(总计 = 4 , connect=None, read=None, redirect=None, status=None)) 在连接被 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败 (_ssl.c:833)'),)' 中断后:/简单/grequests/
连接被 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败 (_ssl.c: 833)'),)': /simple/grequests/ 重试 (Retry(total=2, connect=None, read=None, redirect=None, status=None)) 连接被'SSLError(SSLError(1,' [SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败 (_ssl.c:833)'),)': /simple/grequests/
连接被 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败 (_ssl.c: 833)'),)': /simple/grequests/ 重试 (Retry(total=0, connect=None, read=None, redirect=None, status=None)) 在连接被'SSLError(SSLError(1,' [SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败 (_ssl.c:833)'),)': /simple/grequests/
无法获取 URL https://pypi.python.org/simple/grequests/: 确认 ssl 证书时出现问题: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /simple/grequests/ (Caused by SSLError(SSLError(1, '[SSL : CERTIFICATE_VERIFY_FAILED] 证书验证失败 (_ssl.c:833)'),)) - 跳过找不到满足 grequests 要求的版本(来自 bioservices)(来自版本:)没有为 grequests 找到匹配的分布(来自 bioservices)


我不知道如何解决这个问题。我正在使用 python 3.6.5 和 pip 9.0.3。我试过浏览许多不同的堆栈溢出问题和其他论坛,但都没有运气

4

0 回答 0