如何在Mac上将pip连接修复为127.0.0.1?

时间:2019-03-11 09:29:01

标签: pip connection

点子版本:点子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?

那我该如何解决!谢谢!

2 个答案:

答案 0 :(得分:0)

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

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

pip install --proxy="" <package>欺骗代理

除非失败是基于ssl验证,否则您可以解析跳过验证标志。

答案 1 :(得分:0)

  

为什么我要连接到127.0.0.1?

因为您已经配置了代理,却忘记了它。使用set | fgrep -i proxy在环境变量中查找代理设置。

还要检查您的~/.pip/pip.conf