urllib2.URLError: <urlopen error [Errno 11004] getaddrinfo failed> [英] urllib2.URLError: <urlopen error [Errno 11004] getaddrinfo failed>
本文介绍了urllib2.URLError: <urlopen error [Errno 11004] getaddrinfo failed>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我跑:
urllib2.urlopen('http://google.com')
即使我使用另一个网址,也会出现同样的错误.
even if I use another url, I get the same error.
我很确定我的计算机或路由器上没有运行防火墙,而且互联网(通过浏览器)运行良好.
I'm pretty sure there is no firewall running on my computer or router, and the internet (from a browser) works fine.
推荐答案
就我而言,问题在于某些安装在某个时候在我的机器上定义了一个环境变量 http_proxy,而我没有代理人.
The problem, in my case, was that some install at some point defined an environment variable http_proxy on my machine when I had no proxy.
删除 http_proxy 环境变量解决了问题.
Removing the http_proxy environment variable fixed the problem.
这篇关于urllib2.URLError: <urlopen error [Errno 11004] getaddrinfo failed>的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文