Sublime Text cannot be resolved by using the package control or plug-in installation failure

Source: Internet
Author: User



Sublime text used for more than a year, the company moved recently suddenly found that the package control can not install the new plug-in, although does not affect the use of the original function, or to solve it. Because I use the Windows system, only discuss the solution under WINDOSW. Mac and Linux users can refer to the resolution.



This paper mainly introduces how to open debug mode of sublime text, and analyzes some common error situations in the process of using. Scenario One: Package Control:there is no packages available for installation. Scenario Two: Package Control:unableto download Emmet.please view, the console for more details. Error while loading PyV8 binary:exit code 3 ... Scenario Three: The package control cannot be opened or Packagecontrol is not installed. After a brief introduction of the front-end development of the common package plug-in, and finally add some common shortcut keys and so on.



For more accurate positioning of the problem, it is recommended that the plug-in before the installation of the console (shortcut key ctrl+~), while opening debug mode, so that in the installation process to understand which step out of the problem, and then targeted to solve the problem.



First, turn on debug mode



Debug mode Open method: Set the Debug parameter in the Packagecontrol.sublime-settings file to True, for example, my file is in this location of the installation directory:



D:\Program files\sublime Text 2\data\packages\packagecontrol\ packagecontrol.sublime-settings












For more parameter meanings, see official website https://packagecontrol.io/docs/settings



Second, installation error situation



The following summarizes some common issues that may occur during the installation process:






Scenario One: Package Control:there is no packages available for installation









According to StackOverflow said is IPV6 caused, if our intent service provider (ISP) does not support IPV6 will cause the above error, the original text is as follows:






This error was happened with IPv6 problem. If yourinternet Service Provider (ISP) does not the support for IPv6 you got this error.



For details, please refer to: http://stackoverflow.com/questions/25105139/sublime-text-2-there-are-no-packages-available-for-installation



If there is a problem with IPV6, Curl will print an error like this:



Curl: (7) Failed to connect to xxxxx ...



Find the cause of the problem and proceed to resolve it below.






The first step: get the IPV4 address of Sublime.wbond.net . At the command prompt, enter the following command:



Ping sublime.wbond.net









Step Two: OpenC:\Windows\system32\drivers\etc\hosts文件,增加如下对应关系:{IPv4 address}sublime.wbond.net









Save the file, and then open the package Control (shortcut key ctrl+shift+p) to start the installation.






Scenario Two: Package Control:unableto download Emmet.please View the console for more details./error while loading PyV8 binary:exit Code 3 ...









Similar to this plugin can not download the problem, generally due to slow network speed, or the target domain name is the wall and can not access the cause of normal.



In this case, first check whether the local network can be accessed, detect the download speed is not particularly slow,



If the network speed is too slow, change the time to install again. Another option is to manually download the installation package to GitHub or a third-party website and extract it to the/packages directory under the installation directory.






For example, my Emmet needs to be extracted to the D:\ProgramFiles\Sublime Text 2\data\packages\emmet directory.






Many plugins are dependent on Python and will download Python-related resources at the beginning of the plugin installation.



For example, the Emmet installation will first download the Python version of your system with the same number of bits, which we can see in the Debug window:









There are two of them, indicating that the download failed, usually because the slow speed request time-out or by the wall.



emmet:loading PyV8 binary from Https://raw.github.com/emmetio/pyv8-binaries/master/pyv8-win64.zip



Emmet.pyv8loader:Unable to download package from Https://raw.github.com/emmetio/pyv8-binaries/master/pyv8-win64.zip Wrong URL error



At the same time, Pyv8 download failure will pop up a prompt box:









At this time, we manually download the PYV8 installation package according to the given ZIP package (PyV8 project address is Https://github.com/emmetio/pyv8-binaries#readme, you can choose the corresponding installation package according to the system type), After the download is successful, open the menu Preferences–browser Packages and unzip it into the subdirectory PyV8. For example, my corresponding directory is D:\Program files\sublime Text2\data\packages\pyv8\win64 (if you are a 32-bit system, the final directory is Win32).






In most cases, when the PyV8 is installed, the other plug-ins that are needed for installation can go smoothly.






Scenario Three: Unable to bring up the package control or not installed Packagecontrol



The first time you install or reinstall the same way, first open the console (ctrl+~), but the sublime text version is different, the execution of the command is not the same.






For Sublime Text2 Enter the following command to execute:



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')





For Sublime Text 3, you need to enter the following command:


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)






After execution, the package control installation succeeds. You can now bring up the Packagecontrol command Input Panel (ctrl+shift+p) and enter the install






In addition to using the above command installation method, can also be installed manually, the required access to the official website to view HTTPS://PACKAGECONTROL.IO/INSTALLATION#ST3



III. installation of the official original



The above problem is solved, but think about such a powerful tool, so many questions, skeptical. It took so long to unload a little too bad. But in order to understand the problem at all, mercilessly, decisively uninstalled I have been using the sublime Text 2 a cracked optimized version, which has integrated jsformat,alignment,emmet and other common plug-ins. Download the official version of the website after uninstalling HTTP://WWW.SUBLIMETEXT.COM/2



And the installation is complete.






This installation, first don't worry about opening sublime Text. In order to install conveniently later, decided to no longer use the system default packages installation path C:\Users\Administrator\AppData\Roaming\Data, in sublime Text2 installation directory under the new folder/data, After the folder is created and then opened Sublime Text Program, we find that packages is installed under the currently created folder (my path is D:\Program files\sublime text 2\data). After the other necessary plugins have been installed later, we back up the sublime Text 2 folder, so that we can go anywhere without stepping back to install, quickly deploy our sublime text environment.






The installation of seven or eight plug-ins, and did not appear once the above error, the official version is still more reliable. Although the fee registration prompt will pop up every month, it will not affect the use. I recommend you to install sublime Text 3, I test found that the latest version of this cracked version than the domestic popular version of a V2 to stabilize more, but the support ST3 plug-in is relatively few.



When the official English version is first used, there will be two dependent package upgrade tips:









Or









Click OK to close, regardless.






Iv. Sublime Essential Plugin






Add a few of the necessary development plug-ins, do not understand the role of self-search bar.



Must have: Alignment,jsformat,csscomb,ctags,docblockr,emmet,filediffs,sass,less,sass Build,lessc,git,sublimelinter



There are also a few good, you can choose to use: Terminal,trimmer,colorpicker,convertoutf8 and so on.






V. Supplementary knowledge





Finally, several knowledge needs to be learned:



1. List of installed plugins (some are not inside)



D:\Program files\sublime text2\data\packages\user\package control.sublime-settings



2. Package control common Commands installpackage (install extension), List Packages (list all extensions), remove package (remove extension), Upgrade (upgrade extension)



3. Plugin hotkey conflict, can be customized modify:Preferences > Package Settings > Alignment(or other plug-in name) > Key bindding-user Then write the shortcut key. (Some plugins need to be modified in the configuration file under the installation directory)



4. There is a package control other related issues on the GitHub project to find.



Https://github.com/wbond/package_control/issues?q=is%3Aclosed






For example, the more common problem is the package control fails to download new packages:



https://github.com/wbond/package_control/issues/736



5. Make a list of common shortcut keys :






Ctrl+d Word Selection (press the shortcut key repeatedly to continue to edit the next same text at the same time)



Ctrl+g jump to the appropriate line



Ctrl+j merge rows (multiple rows that need to be merged are selected)



Ctrl+l Select Entire row (press and hold-continue to select the downstream)



Ctrl+m cursor to start or end position within parentheses



Ctrl+t Word Exchange



Ctrl+u Soft Undo



Ctrl+p find files in the current project and quick search; Enter @ To find the main title/function of the file, or enter: Jump to a file line;



Ctrl+r quickly list/jump to a function



Ctrl+k Backspace Delete from cursor to beginning of line



CTRL+KB Toggle Sidebar on/off



CTRL+KK Delete from cursor to end of line



Ctrl+kt Collapsing properties



Ctrl+ku Change to uppercase



CTRL+KL Change to lowercase



Ctrl+k0 Expand All



Ctrl+enter Insert Line (quick line wrapping)



Ctrl+tab tab Toggle in the current window



Ctrl+shift+a Select the cursor position parent tag pair child



Ctrl+shift+d the entire line where the cursor is copied, before inserting the line



Ctrl+shift+f in folders, unlike normal editors, Sublime allows you to add multiple folders to find



Ctrl+shift+k Delete an entire row



Ctrl+shift+l the mouse to select multiple rows (pressing the shortcut key), you can edit the lines at the same time



Ctrl+shift+m Select the contents in parentheses (press and hold-continue to select the parent bracket)



CTRL+SHIFT+P Open Command Panel



ctrl+shift+/Comment Selected content



Ctrl+shift+↑ can move this line of code, with upstream interchange



Ctrl+shift+↓ can move this line of code, with the downstream interchange



Ctrl+shift+[Folding Code



Ctrl+shift+] Unwind code



Ctrl+shift+enter Cursor Front Insertion



Ctrl+pagedown, ctrl+pageup files are switched on and off in the open sequence



CTRL + Z Undo



Ctrl+y Recovery undo



CTRL+F2 setting bookmarks



ctrl+/Comment Entire line (if selected, same as "ctrl+shift+/" effect)



CTRL + left mouse button to select multiple text to edit at the same time



shift+ the right mouse button (or using the middle mouse button) can use the mouse to select the vertical multi-line



Shift+f2 Previous Bookmark



Shift+tab removing indents



Alt+shift+1~9 (non-keypad) screen displays a small window of equal numbers



ALT +. Close the current label



Alt+f3 selected text Press the shortcut key, you can select all the same text at once to edit simultaneously



Tab Indent Auto-complete



F2 Next Bookmark



F9 row sort (by A-Z)



F11 Full Screen mode



Please refer to this article for more shortcut keys http://blog.csdn.net/fovwin/article/details/9102731






About sublime text of the problem is said so much, basically summed up their own use for more than a year to meet the various problems it. Share it and hope it will be useful to everyone.






This article from csdn Space Freshlover Blog "Sublime Text can not use the package control or plug-in installation Failure solution", reproduced please indicate the source, thank you!



http://blog.csdn.net/freshlover/article/details/44261229







Sublime Text cannot be resolved by using the package control or plug-in installation failure


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.