How to use Python2 and 3 at the same time under Windows

Source: Internet
Author: User

How can I switch python2 and 3 freely under the Windows command line? Of course not switch directories! Many posts tell you to change the Python.exe file in the Python2 directory to Python.exe in Python2.exe,pyhton3 directory to Python3.exe. So it is true that the command line can be implemented Python2 execution Python2,python3 execution Python3, but this destroys the PIP.
In fact, the official has long been aware of this problem, but also gives a solution. As soon as Python3 (3.3 or later) is installed, the installer automatically generates a Py.exe program under Windows C. This program is a Python launcher. So if your Windows system has both installed Python2 with Python3 installed, then you can use the following command from Python2 and Python3 by switching operations.
Operation Python2
Py-2 file name
Operation Python3
Py-3 file name

Pip for Operation Python2
Py-2-M PIP command
Pip for Operation Python3
py-3-M PIP command

How to use Python2 and 3 at the same time under Windows

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.