我正在VirtualBox下运行64位的Ubuntu Server 10.04,并且似乎除了 easy_install和pip 之外的所有东西都可以连接到Internet。我已经设置并导出了http_proxy环境变量,并且还在我知道的每个其他位置都设置了代理地址。然而easy_install总是返回“网络不可达”:
:~$ echo $http_proxy
http://192.168.1.25:80/
:~$ grep "http_proxy" /etc/bash.bashrc
export http_proxy=http://192.168.1.25:80/
:~$ grep "http_proxy" /etc/wgetrc
http_proxy = http://192.168.1.25:80/
:~$ ping pypi.python.org
PING pypi.python.org (82.94.164.168) 56(84) bytes of data.
64 bytes from pypi.python.org (82.94.164.168): icmp_seq=1 ttl=53 time=114 ms
64 bytes from pypi.python.org (82.94.164.168): icmp_seq=2 ttl=53 time=113 ms
64 bytes from pypi.python.org (82.94.164.168): icmp_seq=3 ttl=53 time=113 ms
64 bytes from pypi.python.org (82.94.164.168): icmp_seq=4 ttl=53 time=113 ms
64 bytes from pypi.python.org (82.94.164.168): icmp_seq=5 ttl=53 time=114 ms
64 bytes from pypi.python.org (82.94.164.168): icmp_seq=6 ttl=53 time=113 ms
^C
--- pypi.python.org ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5006ms
rtt min/avg/max/mdev = 113.367/113.871/114.678/0.614 ms
:~$ sudo easy_install virtualenv
Searching for virtualenv
Reading http://pypi.python.org/simple/virtualenv/
Download error: [Errno 101] Network is unreachable -- Some packages may not be found!
Reading http://pypi.python.org/simple/virtualenv/
^Cinterrupted
:~$
我什至可以从Python中连接到该站点:
>>> import urllib
>>> obj = urllib.urlopen('http://pypi.python.org/simple/virtualenv/')
>>> obj.readlines()[0]
'<html><head><title>Links for virtualenv</title></head><body><h1>Links for virtualenv</h1><a href="../../packages/source/v/virtualenv/virtualenv-1.5.1.tar.gz#md5=3daa1f449d5d2ee03099484cecb1c2b7">virtualenv-1.5.1.tar.gz</a><br/>\n'
除以外的软件包,我得到了相同的结果virtualenv
。easy_install是在其他地方寻找连接信息,还是我显然缺少了什么?
http_proxy
在没有问题的其他安装中的/ etc / environment中进行设置。