我正在尝试使用easy_install在我的Ubuntu 14.04机器上安装mercurial。我输入此命令以root用户身份安装:
sudo easy_install mercurial
在终端上我收到此错误消息:
Searching for mercurial
Reading https://pypi.python.org/simple/mercurial/
Download error on https://pypi.python.org/simple/mercurial/: [Errno -2] Name or service not known -- Some packages may not be found!
Couldn't find index page for 'mercurial' (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/: [Errno -2] Name or service not known -- Some packages may not be found!
No local packages or download links found for mercurial
error: Could not find suitable distribution for Requirement.parse('mercurial')
任何人都可以帮我解释它为什么不起作用?
PS。我在代理后面运行它,我有所有必需的env变量集。当我运行env
命令时,我有
HTTP_PROXY=http://username:password@172.31.102.14:3128
HTTPS_PROXY=https://username:password@172.31.102.14:3128
作为我的代理集。
答案 0 :(得分:3)
这是sudo的一个问题。如果使用sudo,则变量$ http_proxy在此上下文中是未知的。
您可以使用sudo -i(它会为您打开root shell)然后再次设置代理变量。之后,运行easy_install(不需要sudo,因为你已经是超级用户)