如何在Windows系统中使用easy_install后面的http代理?

2024-04-27 04:49:24 发布

您现在位置:Python中文网/ 问答频道 /正文

当我使用命令时:

easy_install spotter

要安装spotter包,我得到以下错误消息

Searching for spotter
Reading http://pypi.python.org/simple/spotter/
Download error on http://pypi.python.org/simple/spotter/: [Errno 11001] getaddrinfo      failed -- Some packages may not be found!
Reading http://pypi.python.org/simple/spotter/
Download error on http://pypi.python.org/simple/spotter/: [Errno 11001] getaddrinfo failed -- Some packages may not be found!
Couldn't find index page for 'spotter' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
Download error on http://pypi.python.org/simple/: [Errno 11001] getaddrinfo failed -- Some packages may not be found!
No local packages or download links found for spotter
error: Could not find suitable distribution for Requirement.parse('spotter')

这两个环境变量:http_proxyhttps_proxy似乎不起作用?

Installing Python's easy_install using ez_setup.py from behind a proxy server


Tags: orgpypihttpforondownloadpackagesnot
3条回答

必须将代理配置放入Internet Explorer并重新启动终端。

proxy configuration in Internet Explorer

你试过下列方法吗:

$ export http_proxy=http://username:password@some.proxy.com:portnumber
$ export https_proxy=https://username:password@some.proxy.com:portnumber

然后

$ sudo -E easy_install spotter

我遇到了一个与您类似的问题(我支持一个非常严格的防火墙+代理组合),上面的一组命令和组合对我很有用(在GNU/Linux环境中,尤其是Ubuntu)。

在Windows命令提示符下,首先设置两个环境变量:

c:\> set http_proxy=<user>:<password>@<proxy_ip_address>:<port>
c:\> set https_proxy=<user>:<password>@<proxy_ip_address>:<port>

然后,我可以(在同一个终端上)运行:

easy_install spotter

相关问题 更多 >