首页 > 解决方案 > 无法在 Windows 7 上安装 python 库“请求”

问题描述

运行命令时遇到错误

pip install requests

或者

pip3 install requests

在此系统上安装任何其他 python 包时出现同样的错误。我需要在这个系统上打开任何端口吗?

Collecting requests
  WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, stat
us=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL
: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate
in certificate chain (_ssl.c:1108)'))': /simple/requests/
  WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, stat
us=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL
: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate
in certificate chain (_ssl.c:1108)'))': /simple/requests/
  WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, stat
us=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL
: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate
in certificate chain (_ssl.c:1108)'))': /simple/requests/
  WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, stat
us=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL
: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate
in certificate chain (_ssl.c:1108)'))': /simple/requests/
  WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, stat
us=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL
: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate
in certificate chain (_ssl.c:1108)'))': /simple/requests/
  Could not fetch URL https://pypi.org/simple/requests/: There was a problem con
firming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max
 retries exceeded with url: /simple/requests/ (Caused by SSLError(SSLCertVerific
ationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self
signed certificate in certificate chain (_ssl.c:1108)'))) - skipping
  ERROR: Could not find a version that satisfies the requirement requests (from
versions: none)
ERROR: No matching distribution found for requests
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming
 the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retrie
s exceeded with url: /simple/pip/ (Caused by SSLError(SSLCertVerificationError(1
, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certi
ficate in certificate chain (_ssl.c:1108)'))) - skipping

标签: pythonpippython-requests

解决方案


怀疑问题出在防火墙上。但是我必须解决的方法是找到可以在我的组织中安装库的授权过程。问候 KK


推荐阅读