I used to use 2.7 more when I studied.
Want to Practice 3.7 times, two version compatibility issues, distressed for a few days.
Looked up the information and found a good way. Record it and do a share.
This article is mainly about how to install both Python2 and Python3 on the same computer, and PIP can be used normally.
Many of the posts, given the solution, are in the root directory, the Python.exe and Pip.exe file name modified.
But such a method is still not perfect. The version of PIP is prone to conflict and often results in only one pip to use.
There was an unexpected discovery today of another method.
Python installation, reference article: http://www.cnblogs.com/zhengyihan1216/p/6011640.html
The official gave us a perfect solution!!!
That's py.exe!.
Py.exe as an initiator, he exists in the Python3 version of the installation package. Default storage path such as.
This file will be available as long as you have more than 3 Python versions installed on your PC.
Specific Use method:
Start Python2:
Start Python3:
Pip is also launched in the same way as the start Python, which corresponds to Python2 and Python3, respectively.
This is a bit of a hassle when running Python files, and the workaround is that we can declare the Python version in the file header, declaring the following format:
One thing to note here is that the Python version declaration is to be placed first.
Install both Python2 and Python3 under Windows