【发布时间】:2016-11-21 15:19:17
【问题描述】:
我希望 SO 能够帮助解决这个问题。
当我在 virtualenv 中时,我无法 pip 安装任何软件包。我在 Windows 7 和 python 2.7.12 上。
例如,当我像这样使用 git bash 时:
(venv2)
me@myhost ~/git/myrepo (master)
$ pip install requests
我收到以下错误:
Collecting requests
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x02A438F0>: Failed to establish a new connection: [Errno 11003] getaddrinfo failed',)': /simple/requests/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x02A43790>: Failed to establish a new connection: [Errno 11003] getaddrinfo failed',)': /simple/requests/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x02A43B50>: Failed to establish a new connection: [Errno 11003] getaddrinfo failed',)': /simple/requests/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x02A43DD0>: Failed to establish a new connection: [Errno 11003] getaddrinfo failed',)': /simple/requests/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x02A43E50>: Failed to establish a new connection: [Errno 11003] getaddrinfo failed',)': /simple/requests/
Could not find a version that satisfies the requirement requests (from versions: )
No matching distribution found for requests
但是,当我不在 virtualenv 中时,我可以 pip 安装包就好了。我已经阅读了很多关于类似错误的 SO 问题,但没有一个与我的情况非常匹配。
我尝试过的一些事情:卸载并重新安装 python;升级点子;切换 python 版本。
如果您能指出正确的方向,我将不胜感激
【问题讨论】:
标签: python windows pip virtualenv