Home  >  Article  >  Development Tools  >  Solve the problem that Sublime Package Control cannot be installed

Solve the problem that Sublime Package Control cannot be installed

藏色散人
藏色散人forward
2020-09-10 09:23:134434browse

The following tutorial column will introduce to you how to solve the problem that Sublime Package Control cannot be installed. I hope it will be helpful to friends who need it!

Sublime Text3 official website download address: http://www.sublimetext.com/3

Solve the problem that Sublime Package Control cannot be installedThe first thing after downloading is to install the package manager Package Control, but after trying for a long time, it cannot be installed successfully!

1. Install Package Control

A long time ago, if you wanted to install Package Control in Sublime text 3, you had to install Git first, and then enter the code to install it.

But later a convenient installation method came out, which is through the command line:

Through

ctrl `
shortcut key or

View-->show console

Menu opens the console, copy and paste the following code and press Enter:

import urllib.request,os,hashlib; h = 'df21e130d211cfc94d9b0905775a7c0f' + '1e3d39e33b79698005270310898eea76'; 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)
So I tried it, but it didn’t work, an error was reported, and the console prompt is as follows:


## Unable to connect to the server, it should be blocked

Then another way:

Manually download a package control package: https://github.com/wbond/package_control

After opening the link, click Download ZIP on the right:

Unzip the downloaded package and unzip the folder Rename it to Package Control ,

Copy it to the packages directory of sublime, directly menu bar Perferences -->Browse Packages. Then copy the Package Control folder into it

Then click the menu bar again Perferences, you will find two more menus, Package Settings and Package Control, which means that Package Control is installed successfully.

2. Install plug-in

Okay, let’s try to install a plug-in, such as Emmet, Ctrl Shift P to open the console, enter install, select Install Package, press Enter, you have to wait at this time After a while, because Package Control is loading the plug-in list

But unfortunately, it fails again:

It prompts that https://packagecontrol.io/ cannot be accessed channel_v3.json. This should also be blocked...

Solution:

Open Package Settings-->Package Control --> Settings User

Add the following content:

"channels":
	[
		"http://cst.stu.126.net/u/json/cms/channel_v3.json",
	],

As shown:

##http://cst.stu.126.net/u/json/cms /channel_v3.json is a domestic battle point

Then try to install Emmet again, success!

Let’s start the front-end journey! ! !

The above is the detailed content of Solve the problem that Sublime Package Control cannot be installed. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete