How to build Python2 and python3 environments on the same computer (Windows system)

Source: Internet
Author: User

We all know that Python is now mainly used in 2 versions 2.x and 3.x, and these 2 versions of the syntax is a lot different, python3.x is not backwards compatible with 2.x. While 3.x is the mainstream of future Python, many tools and individuals tend to python2.x. So it is necessary to install 2 versions of Python on the same computer.

1, first to the Python official website (https://www.python.org/downloads/) Download 2 version of the installation package.

650) this.width=650; "src=" https://s3.51cto.com/wyfs02/M00/8C/EB/wKiom1h9unrQZ9U8AADrXZPj0Ak601.jpg "title=" 1.jpg "alt=" Wkiom1h9unrqz9u8aadrxzpj0ak601.jpg "/>

2. After the installation package is downloaded, double-click to start the installation, all by default.

3, after the installation is complete, copy the installation path, python2.7 default path is (C:\Python27\), python3.6 default path is (C:\Users\fireman\AppData\Local\Programs\Python\ python36-32\) But this default path is affected by the version, so this is not the path. There are 2 main ways to get an installation path:

The first: Be aware of the installation path when installing. The locations shown in versions 2.7 and 3.6 will vary, see me.

650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M01/8C/EC/wKiom1h9vVixtJjZAABZkL5HZHI318.jpg-wh_500x0-wm_ 3-wmp_4-s_1555355840.jpg "style=" Float:none, "title=" python2.7 default installation Path "alt=" Wkiom1h9vvixtjjzaabzkl5hzhi318.jpg-wh _50 "/>

650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M01/8C/E8/wKioL1h9vViweG85AACRrF0uKKQ078.jpg-wh_500x0-wm_ 3-wmp_4-s_1188413538.jpg "style=" Float:none, "title=" python3.6 default installation Path "alt=" Wkiol1h9vviweg85aacrrf0ukkq078.jpg-wh _50 "/>

The second type: After the general installation, the software will automatically generate shortcuts, not necessarily on the desktop, but will generally be generated in the Start Directory folder. So click on the computer "start" to find a shortcut, and then look at the properties of the shortcut to know the installation directory.

4, modify the python3.6 directory Python.exe renamed to Python3.exe

5, modify the environment variables, add this installation directory

"My Computer" right "properties"--"Advanced system Settings"--"advanced"-"Environment variables" find the path in the system variable (you can create a new one yourself)

650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M01/8C/E8/wKioL1h9v6ySH6LyAABopgb-huc749.png-wh_500x0-wm_ 3-wmp_4-s_1711148919.png "title=" 4.png "alt=" Wkiol1h9v6ysh6lyaabopgb-huc749.png-wh_50 "/>

Double-click Path to add a semicolon and the Python version installation path to the last face of the variable value. Separated by a semicolon (;)) entered in English, refer to. Then click OK

650) this.width=650; "src=" https://s2.51cto.com/wyfs02/M00/8C/EC/wKiom1h9wIzDTdhpAAAxJl6RZsQ355.jpg "title=" 5.jpg "alt=" Wkiom1h9wizdtdhpaaaxjl6rzsq355.jpg "/>

Continue to click OK 2 times.

This is all set up. Using the Win key +r, enter "CMD" in the Run box. Open the cmd window and enter "Python". Again, open another window, enter "Python3" to see the version number information stating that the setup was successful.

650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M00/8C/EC/wKiom1h9wvCyZsqkAABswakOE2Y164.jpg-wh_500x0-wm_ 3-wmp_4-s_1257452709.jpg "style=" Float:none; "title=" 6.jpg "alt=" Wkiom1h9wvcyzsqkaabswakoe2y164.jpg-wh_50 "/>

650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M00/8C/E8/wKioL1h9wvHjqtZmAABjh_swC9g691.jpg-wh_500x0-wm_ 3-wmp_4-s_2735504533.jpg "style=" Float:none; "title=" 76.jpg "alt=" Wkiol1h9wvhjqtzmaabjh_swc9g691.jpg-wh_50 "/>

The way to build a dual version of the environment is here, welcome to visit the comments!



This article is from the "Iythinc" blog, make sure to keep this source http://iythinc.blog.51cto.com/11634450/1892618

How to build Python2 and python3 environments on the same computer (Windows system)

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.