通过代理安装 Python 包

通过代理安装 Python 包

我正在尝试在运行 Ubuntu 14.04 的 PC 上安装 Python 软件包,并且使用了代理。我的尝试失败了。

我尝试了以下方法:

  1. sudo -E easy_install elm
Searching for elm
Reading https://pypi.python.org/simple/elm/
Download error on https://pypi.python.org/simple/elm/: Tunnel connection failed: 403 Forbidden -- Some packages may not be found!
Couldn't find index page for 'elm' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: Tunnel connection failed: 403 Forbidden -- Some packages may not be found!
No local packages or download links found for elm
error: Could not find suitable distribution for Requirement.parse('elm')
  1. sudo -E pip install elm
Downloading/unpacking elm
  Cannot fetch index base URL https://pypi.python.org/simple/
  Could not find any downloads that satisfy the requirement elm
Cleaning up...
No distributions at all found for elm
Storing debug log for failure in /home/guru/.pip/pip.log

我已将以下环境变量设置为:

  • http_proxy export http_proxy=http://username:password@ProxyServerIP:port
  • https_proxy export https_proxy=https://username:password@ProxyServerIP:port

请注意,以上所有链接都可通过浏览器访问。我一直使用apt在 中设置代理来安装软件包,/etc/apt/apt.conf效果很好。但是,我不知道可以对pip或做些什么easy_install

提前致谢。

相关内容