2015-09-06 35 views
2

我正尝试使用easy_install在我的Ubuntu 14.04机器上安装mercurial。我键入此命令来安装为root用户:easy_install不工作:获取错误[Errno -2]名称或服务未知 - 可能找不到某些程序包

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:[email protected]:3128 
HTTPS_PROXY=https://username:[email protected]:3128 

作为我的代理集。

回答

2

这是sudo的问题。如果使用sudo,则变量$ http_proxy在此上下文中是未知的。

您可以使用sudo -i(它会为您打开根shell)然后再次设置代理变量。在那之后,运行的easy_install(无需使用sudo因为你已经超级用户)

有关详细信息:https://superuser.com/questions/258819/easy-install-will-not-connect-through-proxy?answertab=active#tab-top

+0

没有。同样的错误来了。它显示: 'build-essential已经是最新版本了。 build-essential设置为手动安装。 python-dev已经是最新版本了。 python-setuptools已经是最新版本了。' 我们是否需要为easy_install配置代理,或者它需要从env? –

+0

@DeepankarSingh更新了答案。 –

+0

感谢它的工作! (Y):D –

相关问题