如何解决在Windows上python getaddrinfo失败

如果在命令提示符terminal中启动python并尝试打开某个url,我会得到以下结果,尽pipe可通过DNSparsing名称:

C:\Windows\system32>nslookup www.google.de Nicht-autorisierende Antwort: Name: www-cctld.l.google.com Address: 173.194.69.94 Aliases: www.google.de C:\Windows\system32>C:\Python27\python.exe Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import urllib >>> urllib.urlopen("http://www.google.de") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python27\lib\urllib.py", line 84, in urlopen return opener.open(url) File "C:\Python27\lib\urllib.py", line 205, in open return getattr(self, name)(url) File "C:\Python27\lib\urllib.py", line 342, in open_http h.endheaders(data) File "C:\Python27\lib\httplib.py", line 951, in endheaders self._send_output(message_body) File "C:\Python27\lib\httplib.py", line 811, in _send_output self.send(msg) File "C:\Python27\lib\httplib.py", line 773, in send self.connect() File "C:\Python27\lib\httplib.py", line 754, in connect self.timeout, self.source_address) File "C:\Python27\lib\socket.py", line 553, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): IOError: [Errno socket error] [Errno 11001] getaddrinfo failed >>> 

我禁用了防火墙,以pipe理员身份启动了命令提示符,但这几乎是我所能想到的。 nslookup工作得很好,所以我没有看到有什么问题。 有什么build议么?

Solutions Collecting From Web of "如何解决在Windows上python getaddrinfo失败"