首页 > 解决方案 > 如何在我的 Mac 上修复与 127.0.0.1 的 pip 连接?

问题描述

pip 版本:pip 18.0 Python 版本:2.7.15 操作系统:mac 10.13.4

sudo -H pip install virtualenvwrapper
Password:
Collecting virtualenvwrapper
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x101c0e710>, 'Connection to 127.0.0.1 timed out. (connect timeout=15)')': /simple/virtualenvwrapper/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x101c0e810>, 'Connection to 127.0.0.1 timed out. (connect timeout=15)')': /simple/virtualenvwrapper/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x101c0e910>, 'Connection to 127.0.0.1 timed out. (connect timeout=15)')': /simple/virtualenvwrapper/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x101c0ea10>, 'Connection to 127.0.0.1 timed out. (connect timeout=15)')': /simple/virtualenvwrapper/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x101c0eb10>, 'Connection to 127.0.0.1 timed out. (connect timeout=15)')': /simple/virtualenvwrapper/
  Could not find a version that satisfies the requirement virtualenvwrapper (from versions: )
No matching distribution found for virtualenvwrapper

为什么我连接到 127.0.0.1 ?

那么我该如何解决这个问题!谢谢!!!

标签: pipconnection

解决方案


您可能在代理后面连接,您需要解析代理凭据。此错误基本上是当您的 pip 尝试连接到网络以下载软件包安装程序时,但无法建立连接。

尝试:pip install -–proxy=user:pass@host:port <package>

pip install --proxy="" <package>愚弄代理

除非失败发生在 ssl 验证上,否则您可以解析跳过验证标志。


推荐阅读