安装sublime text3
sublime text 3下载地址:http://www.sublimetext.com
- 1.控制台代码
Sublime Text2输入以下命令执行
import urllib2,os,hashlib; h = 'eb2297e1a458f27d836c04bb0cbaf282' + 'd0e7a3098092775ccb37ca9d6b2e4b7d'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler()) ); by = urllib2.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); open( os.path.join( ipp, pf), 'wb' ).write(by) if dh == h else None; print('Error validating download (got %s instead of %s), please try manual install' % (dh, h) if dh != h else 'Please restart Sublime Text to finish installation')
Sublime Text3
import urllib.request,os,hashlib; h = 'eb2297e1a458f27d836c04bb0cbaf282' + 'd0e7a3098092775ccb37ca9d6b2e4b7d'; 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)
- 2.问题
①
远程服务器有问题
使用手动安装
然后手动安装包因为众所周知的原因也没法在官网下
然后就挂过来了
链接: https://pan.baidu.com/s/1QxUQlQ0YSR88YDyW3qp3pQ 提取码: kdms
②
上面这个错误是找到这个安装包存放位置,按要求重命名文件后重启sublime text3
- 3.ctrl+shif+p 后 install package
在利用sublime进行插件下载时,sublime会调用channel_v3.json文件[我装的是sublime text3],点击Preferences->Package Setting->Package Control ->Setting Default,可以看到该文件是远程读取的,这个链接我们也访问不了
然后上git找
V3
{"packages_cache": {}, "repositories": [], "schema_version": "3.0.0", "dependencies_cache": {}}
V2
https://packagecontrol.io/channel.json returns
{"schema_version": "2.0", "certs": {}, "packages_cache": {}, "repositories": []}
$ curl https://packagecontrol.io/channel_v3.json
{"schema_version": "3.0.0", "packages_cache": {}, "repositories": [], "dependencies_cache": {}}%
$ curl https://packagecontrol.io/channel.json
{"packages_cache": {}, "certs": {}, "repositories": [], "schema_version": "2.0"}%
{“schema_version”: “3.0.0”, “packages_cache”: {}, “repositories”: [], “dependencies_cache”: {}}
那就把这个文件存到本地把。
channel_v3.json
链接: https://pan.baidu.com/s/1LaaXSzD4okcAG8CkyeThcA 提取码: jwxi
Preferences->Package Setting->Package Control ->Setting User 中,进行用户设置实现本地访问
或者远程JSON,我用的是这位大神的
http://www.miaoqiyuan.cn/p/package-control-error
基本上能到的坑这位大神都已经罗列了,
!