当我使用下面的代码在Sublime Text上安装Package Control时,我收到了URL错误
Consolde Code
import urllib.request,os,hashlib; h = '2915d1851351e5ee549c20394736b442' + '8bc59f460fa1548d1514676163dafc88'; 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)
错误
>> import urllib.request,os,hashlib; h = '2915d1851351e5ee549c20394736b442' + '8bc59f460fa1548d1514676163dafc88'; 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 "./urllib/request.py", line 1248, in do_open
File "./http/client.py", line 1065, in request
File "./http/client.py", line 1103, in _send_request
File "./http/client.py", line 1061, in endheaders
File "./http/client.py", line 906, in _send_output
File "./http/client.py", line 844, in send
File "./http/client.py", line 822, in connect
File "./socket.py", line 435, in create_connection
File "./socket.py", line 426, in create_connection
TimeoutError: [WinError 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
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "./urllib/request.py", line 156, in urlopen
File "./urllib/request.py", line 469, in open
File "./urllib/request.py", line 487, in _open
File "./urllib/request.py", line 447, in _call_chain
File "./urllib/request.py", line 1268, in http_open
File "./urllib/request.py", line 1251, in do_open
urllib.error.URLError: <urlopen error [WinError 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>
收到此错误后,我检查了packageconreol.io网站。但它没有打开。然后我使用http://www.websitenotworking.com/检查了网站的状态。它回复,该网站无法正常工作。在这个阶段,我如何安装Package控件和安装包?
答案 0 :(得分:3)
网站packagecontrol.io由亚特兰大的Linode主持。现在,它面临着非常复杂的DDoS攻击,因此作为预防措施有选择地阻止其连接。我想他们将在一两天内完成,所以现在只需等待并继续检查网站。您可以在status.linode.com
查看在Linode发生的事情答案 1 :(得分:1)
已经停了好几天了。该网站现在又向上和向下。我很想安装TernJS
答案 2 :(得分:1)
Package Control不是在Sublime Text中安装软件包的唯一方法。 你可以:
包裹文件夹的位置根据O.S.而有所不同。 您可以在this question
中找到它