我在印度的ISP因为某些原因拒绝阻止Github。我一直在尝试手动安装Sublime Text 3的Package Control并使用Sublime Text 3 Console。在这两种情况下,似乎都缺少一个依赖:
Package Control: Installing 1 missing dependencies
Package Control: Attempting to use Urllib downloader due to WinINet error: Error downloading package. Host not found (errno 12007) during HTTP write phase of downloading https://codeload.github.com/codexns/sublime-bz2/zip/1.0.0.
Package Control: Error downloading package. URL error [Errno 11004] getaddrinfo failed downloading https://codeload.github.com/codexns/sublime-bz2/zip/1.0.0.
error: Package Control
Unable to download bz2. Please view the console for more details.
Package Control: Skipping automatic upgrade, last run at 2015-01-03 11:32:25, next run at 2015-01-03 12:32:25 or after
我手动下载了Sublime bz2文件,我现在该怎么办?
一些浏览器告诉我Package Control 3.0有依赖关系:
Once the package is extracted, a custom-generated python file is added to a special package named
0_package_control_loader. For Sublime Text 3, this is a .sublime-package file, whereas for
Sublime Text 2 it is just a folder. The reason for the name (and creating it as a .sublime-
package file in ST3) is to ensure it is the very first non-default package that Sublime Text
loads.
我是否可以手动添加0_package_control_loader.sublime-package
版本(假设我已经安装了Package Control并且缺少此依赖项?
答案 0 :(得分:3)
我遇到了和你一样的问题。以下是我解决它的方式。
打开一个新的txt文件并将代码粘贴到它下面
{"platforms": ["*"], "url": "https://github.com/codexns/sublime-bz2/issues";, "version": "1.0.0", "description": "Python bz2 module", "sublime_text": "*"}
将文件保存到/ bz2并将其文件名重命名为“dependency-metadata.json” 完成这些后,层次结构应如下所示:
/Package
├─/bz2
│ ├─/st2_linux_x32
│ ├─/st2_linux_x64
│ ├─/st2_windows_x32
│ ├─/st2_windows_x64
│ ├─/st3_linux_x32
│ ├─/st3_linux_x64
│ ├─/st3_osx_x64
│ ├─/st3_windows_x32
│ ├─/st3_windows_x64
│ └─dependency-metadata.json
└─/User
├─/c2u_tmp
└─/Package Control.cache
重新启动sublime text3。
希望它有所帮助!
此致
答案 1 :(得分:3)
这对我有用,请参阅:@ godzig的answer,关于这个相关的Github问题:issues/989。它的要点是:
6 - 7 -->means 6 and 7 are related
5 - 4 -->means 5 and 4 are related
4 - 6 -->means 4 and 6 are related
存档。将文件名从0_package_control_loader.sublime-package
更改为02-bz2.py
,错误消失了;至少在我的情况下无论如何。HTH
答案 2 :(得分:1)
我遇到了同样的问题,我尝试使用手动安装来修复它,如下所示: 手册
如果由于某种原因,控制台安装说明对您不起作用(例如在您的网络上有代理),请执行以下步骤以手动安装Package Control:
答案 3 :(得分:0)
在您的ISP取消阻止Github(谁这样做?)之前,您可以下载0_package_control_loader.sublime-package
here。我不知道不同版本的Windows是否存在差异,但这是来自Win8上的ST3。希望它有所帮助!
答案 4 :(得分:0)
Machael Lv的回答对我没有帮助。 然后我刚开始使用sublime文本作为管理员一次,问题消失了 - 现在我可以运行sbt作为ussual并且错误消息不再出现。
答案 5 :(得分:-2)
import urllib.request,os,hashlib;
h = '2deb499853c4371624f5a07e27c334aa' + 'bf8c4e67d14fb0525ba4f89698a6d7e1';
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)