Install Python 2 and Python 3 in Windows.

Source: Internet
Author: User

Install Python 2 and Python 3 in Windows.

Common desktop operating systems include Windows, Mac OS, and ubuntu. Both Mac OS and ubuntu have their own python. Here, we will only introduce the installation of python2.x and python3.x in Windows (Win10 in my use) environment, as well as the configuration problems when python2.x and python3.x coexist.

1. Download python:

: Www.python.org

 

This is the installation package of the latest version of python 2.x and python 3.x that I downloaded.

Ii. Install python 2.x

Double-click the python-2.7.12.amd64.msi and click Next.

Note that python 2.x is installed in the C root directory by default, which is very easy to find. Therefore, we recommend that you install python 3.x in the C root directory.

 

3. Install python 3.x

Select custom installation here, because you need to modify the default installation location. In addition, if the "Add Python 3.5 to PATH" option is selected, environment variables are automatically configured, while python 2.x requires manual configuration.

 

Select "Install for all users" and set the installation path to "C: \ Python35"

 

Iv. Existing Problems

It can be seen that only python 3.xis configured in the current path environment variable, and the default python command is also python 3.x.

 

Therefore, we have two solutions:

  1. Configure the environment variables of python 2.x;
  2. Separate python 2.x and python 3.x commands;

5. Configure the environment variables of python 2.x;

Add the two directories to the path environment variable:

  1. Directory of the python command file: python 2.x installation directory
  2. Directory of pip, easy_install, and other script files: scripts directory under python 2.x installation directory

Operation Procedure: Right-click my computer/computer --> properties --> advanced system settings --> Advanced tab (default) --> environment variable --> Path under system environment variable --> Edit

 

Add the following line to the start position of the Path variable: C: \ Python27; C: \ Python27 \ scripts;

Finally, it is as follows:

 

6. differentiate commands related to python 2.x and python 3.x;

Solution: Add 3 to the names of all command files under python 3.x, for example, python ==> python3.

 

 

VII. test:

Note: You must restart the command terminal. Otherwise, the path variable will not be reloaded.

 

The test found that pip3 has a problem. In fact, the pip version is too low. Just upgrade it: python3-m pip install-U pip.

 

Everything looks okay!

8. Selection of integrated development tools

The ancients cloud "to do what they want, you must first sharpen their tools", select a suitable development tool, can help us improve work efficiency. You can choose from the following tools:

  1. File-only tools: without any prompts, You need to manually write the code and compile and run it manually, such as NotePad;
  2. Simple GUI development tools: there are simple prompts, but the compilation and running must be completed manually, such as notepad ++;
  3. Advanced GUI tools: There are prompts, and the compilation and running processes are automatically completed by the development tools, such as eclipse, Pycharm

Some people think that when learning a programming language, we should use a simple tool such as notepad or notepad ++ to reduce the dependency on advanced GUI development tools, in this way, you can better understand the running process and principle of the language that is blocked by development tools. But let's take a look at this. For example, I think that when a newbie starts to use a development tool without any tips, it will reduce the exercise efficiency and even further crack down on self-confidence and learning motivation. If you fear it from the beginning, it will be difficult to learn it well in the future.

Of course, the choice is determined by the viewer. The recommended python GUI tool is Pycharm for the following reasons:

  1. Cross-platform. Generally, many common desktop operating systems can be downloaded.
  2. It can be divided into community edition and commercial edition. Community edition is free to use, but there will be fewer features (enough for new users). Commercial edition features are comprehensive, but you need to pay.

Pycharm 2017 activation code

Copy codeThe Code is as follows:
BIG3CLIK6F-eyJsaWNlbnNlSWQiOiJCSUczQ0xJSzZGIiwibGljZW5zZWVOYW1lIjoibGFuIHl1IiwiYXNzaWduZWVOYW1lIjoiIiwiYXNzaWduZWVFbWFpbCI6IiIsImxpY2Vuc2VSZXN0cmljdGlvbiI6IkZvciBlZHVjYXRpb25hbCB1c2Ugb25seSIsImNoZWNrQ29uY3VycmVudFVzZSI6ZmFsc2UsInByb2R1Y3RzIjpbeyJjb2RlIjoiQUMiLCJwYWlkVXBUbyI6IjIwMTctMTEtMjMifSx7ImNvZGUiOiJETSIsInBhaWRVcFRvIjoiMjAxNy0xMS0yMyJ9LHsiY29kZSI6IklJIiwicGFpZFVwVG8iOiIyMDE3LTExLTIzIn0seyJjb2RlIjoiUlMwIiwicGFpZFVwVG8iOiIyMDE3LTExLTIzIn0seyJjb2RlIjoiV1MiLCJwYWlkVXBUbyI6IjIwMTctMTEtMjMifSx7ImNvZGUiOiJEUE4iLCJwYWlkVXBUbyI6IjIwMTctMTEtMjMifSx7ImNvZGUiOiJSQyIsInBhaWRVcFRvIjoiMjAxNy0xMS0yMyJ9LHsiY29kZSI6IlBTIiwicGFpZFVwVG8iOiIyMDE3LTExLTIzIn0seyJjb2RlIjoiREMiLCJwYWlkVXBUbyI6IjIwMTctMTEtMjMifSx7ImNvZGUiOiJEQiIsInBhaWRVcFRvIjoiMjAxNy0xMS0yMyJ9LHsiY29kZSI6IlJNIiwicGFpZFVwVG8iOiIyMDE3LTExLTIzIn0seyJjb2RlIjoiUEMiLCJwYWlkVXBUbyI6IjIwMTctMTEtMjMifSx7ImNvZGUiOiJDTCIsInBhaWRVcFRvIjoiMjAxNy0xMS0yMyJ9XSwiaGFzaCI6IjQ3NzU1MTcvMCIsImdyYWNlUGVyaW9kRGF5cyI6MCwiYXV0b1Byb2xvbmdhdGVkIjpmYWxzZSwiaXNBdXRvUHJvbG9uZ2F0ZWQiOmZhbHNlfQ =-release/release + release/sCltpoPWlJtDOcw/release =-release + release/78TmVqFl8nOeD5 + release + e1doC6wht4I4 + release + I4ZI + release/ xVy/release + release/8 vzMW/release + 0gpdq3x9r3 + kJbmAm8w + release + c/F4tlK/release/OEur1 + release/Sk1VfOjvS + signature + signature + Ga + aDY6f/qXZuUCEUOH3QUNbbCUlviSz6 + GiRnt1kA9N2Qachl + signature/cG ++ 2 + wNWP + HtBhVxMRNTdVhSm38AknZlD + signature + Signature =

The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.

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.