Sublime Text 3 插件的安裝、升級和卸載,以及安裝package control 出現問題解決過程記錄

sublime text3 可使用 Package Control 安裝其餘插件,來提升開發效率。因此咱們先要知道Package Control是怎麼安裝的。

一、安裝Package Control

Package Control官網安裝:https://packagecontrol.io/installation

Simple:

The simplest method of installation is through the Sublime Text console. The console is accessed via the ctrl+` shortcut or the View > Show Console menu. Once open, paste the appropriate Python code for your version of Sublime Text into the console.python

首先經過快捷鍵 ctrl+` (mac電腦esc下面的按鍵) 或者 View > Show Console 打開控制檯(注:若是安裝有QQ輸入法等快捷鍵有衝突的狀況時候,能夠先修改相關軟件功能快捷鍵的設置),輸入如下代碼,enter便可.git

import urllib.request,os,hashlib; h = '6f4c264a24d933ce70df5dedcf1dcaee' + 'ebe013ee18cced0ef93d5f746d80ef60'; 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)github

 

二、自動安裝package control 失敗json

報錯展現:安全

File "./python3.3/urllib/request.py", line 1248, in do_openapp

........ide

During handling of the above exception, another exception occurred:ui

Traceback (most recent call last):url

  File "<string>", line 1, in <module>spa

  File "./python3.3/urllib/request.py", line 156, in urlopen

.........

解決方式:顯然自動安裝已經不行,按照官網進行手動安裝便可。

If for some reason the console installation instructions do not work for you (such as having a proxy on your network), perform the following steps to manually install Package Control:

  1. Click the Preferences > Browse Packages… menu
  2. Browse up a folder and then into the Installed Packages/folder
  3. Download Package Control.sublime-package and copy it into the Installed Packages/ directory
  4. Restart Sublime Text

三、不能進行package control:install package,以及後續插件安裝

報錯展現:

Package Control: Unable to download https://packagecontrol.io/channel_v3.jsonafter 3 attempts

Emmet: No need to update PyV8
Package Control: Skipping automatic upgrade, last run at 2019-02-26 18:03:18, next run at 2019-02-26 19:03:18 or after
Package Control: Unable to download  https://packagecontrol.io/channel_v3.jsonafter 3 attempts
Unable to open /Users/yoowei/Library/Application Support/Sublime Text 3/Packages/Package Control/Package Control.sublime-settings
Detected ASCII vs Undefined with 100% confidence
 

* 下載Package Control手動安裝(詳見第一個問題)
* 科、學、上、網下載channel_v3.json,記事本打開,找到"schema_version": "3.0.0".把3.0.0改爲2.0,保存
* 把channel_v3.json放到一個安全不會被刪除的目錄下。
* subline菜單欄中的prefrences->package setting->Package control->setting-user。在{}中加入
"channels":
[
"channel_v3的存放目錄完整路徑"
],
* 保存後,ctrl+shift+p,正常安裝就成了。
以前安裝失敗緣由:channel_v3.json被牆了,沒法下載下來。

完美解決!
四、Sublime Text 3 插件的安裝、升級和卸載
1) 快捷鍵:command+shift+p 打開命令面板
2)插件安裝: 輸入:install ,選擇「Install package」 ,而後在新彈出的窗口中查詢要安裝的插件,點擊須要安裝的插件,便可;
3)升級插件: 輸入:upgrade,選擇「upgrade packages」,若是有列表出來則有插件須要更新,而後點擊須要升級的插件便可;
4)刪除插件: 輸入:remove,選擇「remove package」,而後彈出的列表就是可進行卸載的插件,想卸載哪一個點擊便可;
相關文章
相關標籤/搜索