我希望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安装包。我读过很多关于类似错误的问题,但没有一个与我的情况非常匹配。
我试过一些事情:卸载并重新安装python;升级PIP;切换Python版本。
如果你能给我指明正确的方向,我将不胜感激
2条答案
按热度按时间p3rjfoxz1#
老问题,但我只是有一个非常相似的问题,并没有张贴答案。
当我的回购协议在我的G:驱动器,而Python安装在C:上。将存储库移动到C:驱动器解决了我的问题,我能够使用pip安装我的venv requirementsidertxt。
在G上:\
在C:\上
cqoc49vn2#
netsh接口ipv4设置子接口“Wi-Fi”mtu=1472存储=持久
尝试运行上面的命令。2这可能会有帮助。3有时候安装软件包的问题可能与你的防火墙或网络提供商有关,所以我们将其保存为永久性的。