Mac Sublime Text 3 configuration python environment and installation plugin

Source: Internet
Author: User
Tags sublime text


First, download the installation sublime Text 3


Official website: HTTP://WWW.SUBLIMETEXT.COM/3


Ii. Configuring the Python Development environment 1. Click on the lower right corner and select Python2. Add a compilation environment python3.6


My Mac default is python2.7 version, install python3.6, now to configure sublime text using python3.6 compilation environment



Tools -> Build System -> New Build System



Paste the following code in the open file



{
"cmd": ["/library/frameworks/python.framework/versions/3.6/bin/python3", "-U", "$file"],
"File_regex": "^[]*file \" (...) \ ", line ([0-9]*)",
"Selector": "Source.python"

}
Remember to change the Python path in the above code to your path



Save the file, give the file a name such as Python3, do not change the suffix, save in the default location



Tools -> Build System Select the compilation environment you just set. Just select Python3 as soon as the file is named Python3.


3. The test environment is correct


在sublime text 中敲 print (‘hello‘),Save, compilecommand + B



Printinghellojust means it worked.


Third, install Sublime text python plugin 1.Sublime text 3 Install the package Control


The package control contains a lot of plugins that you can choose to install later.



View->show the Console menu, open the command line and paste the following code at the bottom line:


Import ' Package Control.sublime-package ' ' WB ' ' http://sublime.wbond.net/ ' + pf.replace (','%20'). Read ())


Click Return to run.



If the package control option is available under the sublime Text->preferences, it means that it has been successfully installed.


2. Installing plugins


Open Sublime Text->preferences->package Control



Select: Package Control:install Package






The following interface appears






Enter the plugin you need, such as Anaconda, and select the plugin below to install it.


A. Plugin Anaconda


Anaconda:anaconda is a Python release for scientific computing that supports Linux, MAC, Windows, and provides package management and environmental management capabilities that can easily resolve multiple versions of Python coexistence, switching, and various third-party package installation issues. Anaconda uses tools/commandscondato manage package and environment, and it already contains Python and related companion tools.



Configuration Anaconda: Enter sublime text-> preferences, package settings-> Anaconda, Settings-default, select Settings-defa Ult option, search for "Python_interpreter" key, then change the key value, the key value is the path of Python (terminal input which Python view Mac with Python path, enter which Python3 Check the path of the python3 you installed, for example: "/usr/local/bin/python3", then the compile-time selection of Python can be used


B. PluginsSublimeCodeIntel


Python auto-complete plug-in, after the installation, theSublime Text-> preferences -> package Settingsfollowing will be moreSublimeCodeInteloptions






Mac Sublime Text 3 configuration python environment and installation plugin


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.