Windows10 Python3 and Python2 simultaneously install Python2.exe, Python3.exe and PIP2, PIP3 settings

Source: Internet
Author: User

1. Add Python2 to System environment variables

Open, Control Panel \ System and Security \ System, select Advanced system settings, environment variables, select Path, click Edit, New, add D:\Python\python27 and D:\Python\python27\Scripts to environment variables respectively.

Note:The Python3 installation can optionally be automatically added to the system environment variable, as is not selected, and the method is the same as the Python2 add process.

2, modified Python.exe name for Python2.exe and Python3.exe

Locate the installation directories for Python2 and Python3, modify the Python.exe and Pythonw.exe names in python2.7.9 and python3.5.2 Python2.exe, Pythonw2.exe and Python3.exe, Pythonw3.exe.

Then run the cmd command and enter Python2 to run the python2.7.9 version

Enter Python3 to run the python3.5.2 version

At this point, Python2 and Python3 are installed.

3, PIP2 and PIP3 settings

The Python installation package requires the Package management tool PIP, but when both Python2 and Python3 are installed, Pip is just one of the versions, and the following will provide a way to modify the two-version Pip so that the two Python versions of PIP can coexist.

In the DOS command box, enter the command, python3-m pip install--upgrade pip--force-reinstall, to show that the reinstallation was successful.

In the DOS command box, enter the command, python2-m pip install--upgrade pip--force-reinstall, to show that the reinstallation was successful.

The two versions of PIP information can now be viewed through pip2-v and pip3-v, with the ability to install their own Python packages later by running Pip2install xxx and pip3 install XXX.

At this point, PIP2 and PIP3 modified successfully.

Windows10 Python3 and Python2 simultaneously install Python2.exe, Python3.exe and PIP2, PIP3 settings

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.