首页 > 代码库 > Ubuntu16.04安装sublime text 3并配置Python开发环境
Ubuntu16.04安装sublime text 3并配置Python开发环境
打开终端,添加sublime text 3的仓库:
sudo add-apt-repository ppa:webupd8team/sublime-text-3
按enter键继续
更新软件库:
sudo apt-get update
安装Sublime Text 3:
sudo apt-get install sublime-text-installer
安装package control:
ctr+`调出控制台然后粘贴如下python代码:
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)
建议去官方网址复制粘贴代码:https://packagecontrol.io/installation
激活:
—– BEGIN LICENSE —–
Free Communities Consultoria em Informática Ltda
Single User License
EA7E-801302
C154C122 4EFA4415 F1AAEBCC 315F3A7D
2580735A 7955AA57 850ABD88 72A1DDD8
8D2CE060 CF980C29 890D74F2 53131895
281E324E 98EA1FEF 7FF69A12 17CA7784
490862AF 833E133D FD22141D D8C89B94
4C10A4D2 24693D70 AE37C18F 72EF0BE5
1ED60704 651BC71F 16CA1B77 496A0B19
463EDFF9 6BEB1861 CA5BAD96 89D0118E
—— END LICENSE ——
配置Python环境:
Ctrl+shift+P打开package control:输入install Package
然后输入Anaconda,安装。
测试Python代码,发现代码上有方框。
解决办法:
Preferences - Package Settings - Anaconda - Setting User
输入;
{
"anaconda_linting": false,
//保存文件后自动pep8格式化
"auto_formatting": true,
}
保存,然后ctrl+B运行Python代码。
Ubuntu16.04安装sublime text 3并配置Python开发环境