Python をさらに学習しようとしていますが、障害にぶつかっています。urllib2/urllib が正しく動作しません。これを行うresponse = urllib2.urlopen('http://python.org/')
と、次のエラーが発生します。
Traceback (most recent call last):
File "<pyshell#6>", line 1, in <module>
response = urllib2.urlopen('http://python.org/')
File "C:\Python27\lib\urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "C:\Python27\lib\urllib2.py", line 400, in open
response = self._open(req, data)
File "C:\Python27\lib\urllib2.py", line 418, in _open
'_open', req)
File "C:\Python27\lib\urllib2.py", line 378, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 1207, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "C:\Python27\lib\urllib2.py", line 1177, in do_open
raise URLError(err)
URLError: <urlopen error [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond>
次のようなものでも同じエラーが発生するため、DNS の問題ではありませんURL = "http://173.194.75.94"
。f=urllib.urlopen(URL)
私はプロキシやファイアウォールの背後にいません。いつものように無効になっている私のWindowsのデフォルトファイアウォールを除いて。それでも例外に python と pythonw.exe を追加しました。
これを解決する方法の手がかりはありますか?