使用系统代理时,Firefox 无法访问互联网。将代理更改为自动后,Firefox 下载正常。
在终端中,当我尝试使用 wget 下载时,终端停在
>>wget www.google.com
--2015-06-05 23:38:09-- http://www.google.com/
Resolving www.google.com... 216.58.211.100, 2a00:1450:4007:80d::2004
Connecting to www.google.com|216.58.211.100|:80...
其他程序也无法访问
>>pip install obspy
Collecting obspy
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f2ff764ced0>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/obspy/
但我可以 ping
>>ping www.google.com
PING www.google.com (216.58.211.100) 56(84) bytes of data.
64 bytes from par03s15-in-f4.1e100.net (216.58.211.100): icmp_seq=1 ttl=50 time=14.1 ms
64 bytes from par03s15-in-f4.1e100.net (216.58.211.100): icmp_seq=2 ttl=50 time=14.2 ms
64 bytes from par03s15-in-f4.1e100.net (216.58.211.100): icmp_seq=3 ttl=50 time=14.2 ms
64 bytes from par03s15-in-f4.1e100.net (216.58.211.100): icmp_seq=4 ttl=50 time=14.1 ms
64 bytes from par03s15-in-f4.1e100.net (216.58.211.100): icmp_seq=5 ttl=50 time=14.1 ms
^C
--- www.google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4498ms
rtt min/avg/max/mdev = 14.120/14.163/14.202/0.032 ms
>>ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_req=1 ttl=54 time=7.96 ms
64 bytes from 8.8.8.8: icmp_req=2 ttl=54 time=8.06 ms
64 bytes from 8.8.8.8: icmp_req=3 ttl=54 time=7.96 ms
64 bytes from 8.8.8.8: icmp_req=4 ttl=54 time=8.01 ms
64 bytes from 8.8.8.8: icmp_req=5 ttl=54 time=7.98 ms
^C
--- 8.8.8.8 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4004ms
rtt min/avg/max/mdev = 7.964/7.998/8.060/0.067 ms
答案1
这是你的代理。你的环境在这里很有用(linux?Windows?)但我猜是 linux。
您需要找到您的实际代理设置(Firefox 正在获取该设置) - 这里需要进行一些猜测,但是你可以使用 curl并测试每一个已知的自动代理 URL 或可能的变体。
然后您需要设置一个可以在 pip 和 wget 上运行的 http_proxy 环境变量。