2

当我使用下面的代码在 Sublime Text 上安装 Package Control 时,出现 URL 错误

销售代码

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/检查了网站的状态。它回复,网站不工作。在这个阶段我如何安装包控制和安装包?。

4

3 回答 3

3

网站 packagecontrol.io 由亚特兰大的 Linode 托管。它现在面临着非常复杂的 DDoS 攻击,因此有选择地阻止它们的连接以作为预防措施。我想他们会在一两天内起来,所以现在只需等待并继续检查网站。您可以在status.linode.com上查看 Linode 发生的事情

于 2016-01-03T06:27:51.827 回答
1

这两天已经下线了。该网站时不时地启动并再次关闭。非常想安装 TernJS

于 2016-01-02T11:41:36.163 回答
1

包控制不是在 Sublime Text 中安装包的唯一方法。您可以:

  • 下载包并解压到包文件夹中
  • git克隆包文件夹中的包源

包文件夹的位置因操作系统而异你可以在这个问题中找到它

于 2016-01-06T07:56:43.157 回答