We may have multiple versions of Python installed under the same system, After all Python2.7 and Python3.6 still have different needs, but in the cmd command window is we may default system variable environment is one of the version, when we need to operate in the CMD Command window to another version, I had to change the system environment variables Python2.7 and Pyth on3.6 position before and after order, so that the location of the temporarily needed version is in the front of the environment variable .... But ~ ~ This is not a good way to worry, finally in today, I get to a new approach, and now feel good.
==================== below into the body =================
For two different versions of Python, we can put the default Python2.7->python, and Python3.6->python3, which requires us to rename the Python.exe under the Python installation directory.
(In this case, in cmd, Python defaults to Python2.7, while Python3 stands for Python3.5)
Effect:
Additional Instructions:
For different versions of the installation module, you can view the PIP under the installation path C:\Python27\Scripts
By modifying the first line of the pip*-script.py file, point to a different python.exe
For example, let PIP3 and pip3.5 both target the python3.6 version, then change the first line to #!c:\python36\python3.exe,如果提示找不到pip3-script.py,请重新copy pip-script.py --》 pip3-script.py
pip2.7 default for python2.7 version is Python.exe (because the interpreter in Python27 is still python.exe)
Results after modification:
Note the difference between the PIP3, the former is not modified, the default point to python2.7, the latter is modified to point to python3.6
How to switch Python2.7 and Python3.6 in the CMD Command window under Windows system