首页 > 解决方案 > 无法安装 urllib3,在使用 pip 之间有代理?

问题描述

基本上我正在尝试安装 urllib3 但我正在反击以下错误:

 `C:\Python 3.7\Scripts>pip3.7.exe install urllib3
 Collecting urllib3
   Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None))
  after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection
 .VerifiedHTTPSConnection object at 0x03285170>, 'Connection to pypi.org timed ou
 t. (connect timeout=15)')': /simple/urllib3/
   Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None))
  after connection broken by      'ConnectTimeoutError(<pip._vendor.urllib3.connection
 .VerifiedHTTPSConnection object at 0x00D3E2B0>, 'Connection to pypi.org timed ou
 t. (connect timeout=15)')': /simple/urllib3/
   Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None))
  after connection broken by           'ConnectTimeoutError(<pip._vendor.urllib3.connection
 .VerifiedHTTPSConnection object at 0x032AB610>, 'Connection to pypi.org timed ou
 t. (connect timeout=15)')': /simple/urllib3/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None))
  after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection
 .VerifiedHTTPSConnection object at 0x032AB670>, 'Connection to pypi.org timed ou
 t. (connect timeout=15)')': /simple/urllib3/
   Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None))
  after connection broken by      'ConnectTimeoutError(<pip._vendor.urllib3.connection
 .VerifiedHTTPSConnection object at 0x032AB5F0>, 'Connection to pypi.org timed ou
 t. (connect timeout=15)')': /simple/urllib3/


pip3.7.exe install urllib3
   Could not find a version that satisfies the requirement urllib3 (from versions: )
 No matching distribution found for urllib3

我试过了: pip3.7.exe install urllib3两者pip install urllib3都有同样的问题

仅供参考:我位于代理后面。

非常感谢所有回复

标签: pythonpipurlliburllib3

解决方案


你说你在你的机器上使用代理服务器。这可能是问题所在,这就是您的错误消息说它超时的原因。pip需要告知代理:

$ pip3.7.exe install urllib3 --proxy=http://name.of.proxy.com

此时它将使用代理并完成其请求。不能保证它会找到什么,但错误消息应该更有帮助。


推荐阅读