Sublime text 3不能通过Package Control安装插件
我安装了Package Control,然后install package,Install Package安装插件没有反应,安装不了插件, Sublime text 3不能通过Package Control安装插件,
Exception in thread Thread-5:
Traceback (most recent call last):
File "X/threading.py", line 639, in _bootstrap_inner
File "D:\Sublime Text Build 3033\Data\Packages\Package Control\package_control\package_installer.py", line 241, in run
self.result = self.manager.install_package(self.package)
File "D:\Sublime Text Build 3033\Data\Packages\Package Control\package_control\package_manager.py", line 489, in install_package
package_bytes = download_manager.fetch(url, 'Error downloading package.')
File "D:\Sublime Text Build 3033\Data\Packages\Package Control\package_control\download_manager.py", line 180, in fetch
return self.downloader.download(url, error_message, timeout, 3, prefer_cached)
File "D:\Sublime Text Build 3033\Data\Packages\Package Control\package_control\downloaders\wininet_downloader.py", line 346, in download
raise HttpError("HTTP error %s %s" % (general['status'], general['message']))
TypeError: __init__() missing 1 required positional argument: 'code'
Answers
Ctrl+` 看看控制台有没有报什么错,我arch下sl2的PackageControl也不能用,报错信息如下:
Exception in thread Thread-1:
Traceback (most recent call last):
File ".\threading.py", line 532, in __bootstrap_inner
File "./Package Control.py", line 4783, in run
File "./Package Control.py", line 3583, in record_usage
File "./Package Control.py", line 2695, in download_url
File "./Package Control.py", line 2107, in download
File "./Package Control.py", line 1588, in execute
File ".\subprocess.py", line 633, in __init__
File ".\subprocess.py", line 1139, in _execute_child
OSError: [Errno 13] 权限不够
顺便借个地求帮助。。
后续
win7(sl2正常运行)下我在PackageControl的debug模式下发现:
Package Control: Download Debug
URL: https://sublime.wbond.net/repositories.json
Resolved IP: 50.116.34.243
Timeout: 30
Package Control: Urllib2 Debug Proxy #此处用的是Urllib2
http_proxy:
https_proxy:
proxy_username:
proxy_password:
Package Control: Urllib2 HTTPS Debug General
Connecting to sublime.wbond.net on port 443
Package Control: Urllib2 HTTPS Debug General
Connecting to sublime.wbond.net on port 443
CA certs file at C:\Users\Leo\AppData\Roaming\Sublime Text 2\Packages\Package Control\certs\ca-bundle.crt
loaded 1178 snippets
Successfully upgraded connection to sublime.wbond.net:443 with SSL
Server SSL certificate:
subject: CN=sublime.wbond.net,OU=Domain Control Validated - RapidSSL(R),OU=See www.rapidssl.com/resources/cps (c)12,OU=GT52951423,O=sublime.wbond.net,C=US,serialNumber=myhMyQY3GDqAVOO0J/XxhlNzHaUdNIlo
common name: sublime.wbond.net
expire date: Feb 26 16:28:18 2015 GMT
Certificate validated for sublime.wbond.net
Package Control: Urllib2 HTTPS Debug Write
GET /repositories.json HTTP/1.1
Host: sublime.wbond.net
Connection: close
Accept-Encoding: gzip,deflate
User-Agent: Sublime Package Control
Package Control: Urllib2 HTTPS Debug Read
HTTP/1.1 200 OK
Server: nginx
Date: Thu, 20 Jun 2013 04:41:13 GMT
Content-Type: application/json
Content-Length: 126847
Last-Modified: Thu, 20 Jun 2013 04:17:17 GMT
Connection: close
Vary: Accept-Encoding
ETag: "51c2824d-1ef7f"
Content-Encoding: gzip
Package Control: No updated packages
但是在我的Arch下
Package Control: Download Debug
URL: https://sublime.wbond.net/repositories.json
Resolved IP: 50.116.34.243
Timeout: 30
Package Control: Curl Debug Proxy #此处用的是curl
http_proxy:
https_proxy:
proxy_username:
proxy_password:
Package Control: Trying to execute command /usr/include/curl --user-agent 'Sublime Package Control' --connect-timeout 30 -sSL --compressed --dump-header /tmp/tmptv5Nt1 --cacert '/home/leo/.config/sublime-text-2/Packages/Package Control/certs/ca-bundle.crt' -v https://sublime.wbond.net/repositories.json
用的是curl,作者的原话是“Because ST2 does not include the ssl module on Linux and thus urllib can't be used for HTTPS downloads.”
所以我自己改了 package control.py 把/usr/include/curl 改为了/usr/bin/curl 然后就居然成功了。
https://github.com/wbond/sublime_pack... 这个是我提的issues
总之我是这么解决的,sl3可能不一样,不过多看下debug信息总能发现点什么。