Python installation environment configuration, Python module additions, sublime text editor configuration

Source: Internet
Author: User
Tags sublime text sublime text editor

This article describes the corresponding installation and configuration of python in windows environment.

The first step is to enter the official website to find the installation package. The official website address is as follows: https://www.python.org/downloads/
Find the corresponding 2.7.x or 3.x version to download, please be sure to confirm that the requirements are 2.7 or 3.x. There is a big difference between the two versions of Python.

Here it is assumed that your installation address is D: \ python, the following are the detailed configuration steps:

1.click into my computer
2. Select system properties,
3. Click Advanced System Settings,
4. Click the Environment Variables button, find the Path variable in the System Variables column, double-click, and add the last two columns below.
5. Verify, type WIN + R on the keyboard, enter cmd, a black window of bat will pop up, enter python -v, the last few lines show the python version number is the successful setting.
6.python module installation, for example, now I want to download the xlwt module, then find the corresponding official website, download and decompress the corresponding compressed package, the following is the decompression directory structure:
7. Hit Win + R with your keyboard, enter cmd, enter the bat window, and change the current directory to the above unzipped directory. We enter the following command:
Python set.py install
 Next, please check the corresponding log. If the execution is successful, the module is installed, and you can import the module when you write the code.
(In addition, the pip tool can also install and download other modules, the instructions are as follows: pip install xxxx module)
8. The IDE that comes with Python is not easy to use. Here we recommend Sublime text as an editor. Go to the official website to download and install it. Click to enter Sublime Text. We need to configure Sublime text. Click Tools-> Build System-> New build Systems.
{
 "shell_cmd": "make"
}


Change the content to the following
{
 "cmd": ["python", "-u", "$ file"],
 "file_regex": "^ [] * File \" (... *?) \ ", line ([0-9] *)",
 "selector": "source.python",
 "encoding": "cp936",
}

Notice the last line "encoding": "cp936".

We need to check if our computer is also cp936

 

The query steps are as follows:

1.Win + R + cmd
2. Click on properties,
3. My computer is cp936


9. Save your file. I named it Mypython.sublime-build. After saving it, select tools-> Build System-> MyPython before compiling. After writing the code, press Ctrl + B to run successfully.

 

The above is from python installation to sublime text configuration. If you have any questions, you can leave a message at any time.

Python installation environment configuration, python module addition, sublime text editor configuration

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.