【问题标题】:How to use easy_install behind a http proxy on windows?如何在 Windows 上的 http 代理后面使用 easy_install?
【发布时间】:2013-09-21 15:56:37
【问题描述】:

当我使用命令时:

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

【问题讨论】:

  • 设置 http_proxy 对我有用。你到底在做什么?

标签: python proxy easy-install


【解决方案1】:

您是否尝试过以下操作:

$ 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)。

【讨论】:

  • 这对我有用。我错过了sudo 上的-E
【解决方案2】:

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

proxy configuration in Internet Explorer

【讨论】:

    【解决方案3】:

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

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

    然后,我能够运行(在同一个终端):

    easy_install spotter
    

    【讨论】:

      猜你喜欢
      • 2019-12-12
      • 2014-05-13
      • 2012-03-30
      • 1970-01-01
      • 2015-01-23
      • 2012-11-23
      • 2014-10-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多