urllib.error.URLError:<urlopen error =“”[errno =“”11004] =“”getaddrinfo =“”failed =“”>

时间:2017-01-26 10:26:51

标签: proxy sublimetext3

我正在尝试使用AngularJS配置sublime text 3。我将我在互联网上找到的用于sublime text 3的消息复制到控制台以安装包控制器:

import urllib.request,os,hashlib; h = 'df21e130d211cfc94d9b0905775a7c0f' + '1e3d39e33b79698005270310898eea76'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)

我收到了这个错误:

Traceback (most recent call last):
  File "./python3.3/urllib/request.py", line 1248, in do_open
  File "./python3.3/http/client.py", line 1065, in request
  File "./python3.3/http/client.py", line 1103, in _send_request
  File "./python3.3/http/client.py", line 1061, in endheaders
  File "./python3.3/http/client.py", line 906, in _send_output
  File "./python3.3/http/client.py", line 844, in send
  File "./python3.3/http/client.py", line 822, in connect
  File "./python3.3/socket.py", line 417, in create_connection
socket.gaierror: [Errno 11004] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "./python3.3/urllib/request.py", line 156, in urlopen
  File "./python3.3/urllib/request.py", line 469, in open
  File "./python3.3/urllib/request.py", line 487, in _open
  File "./python3.3/urllib/request.py", line 447, in _call_chain
  File "./python3.3/urllib/request.py", line 1274, in http_open
  File "./python3.3/urllib/request.py", line 1251, in do_open
urllib.error.URLError: <urlopen error [Errno 11004] getaddrinfo failed>

我在互联网上找到了不同的解决方案,但没有任何方法可以帮助我。如果你能帮助我,我将不胜感激。谢谢!

0 个答案:

没有答案