Windows install python2 and python3+ at the same time using pip

If you still want to use traditional python x-***.py or pip install *****

Please refer to this blog post:

https://blog.csdn.net/qiang12qiang12/article/details/53239866

 

The official method is introduced below. You do not need to modify any settings. Use it directly after installation:

Official solution

       Python community: When we installed Python3 (>=3.3), the Python installation package actually installed a launcher py.exe in the system, which is placed under the folder C:\Windows\ by default. This launcher allows us to specify whether to use Python2 or Python3 to run the code.

py -2 ***. py
py -3 ***. py

If
#! python2
or is added to #! python3
the code file, it means that the code file uses Python2 or Python3 to interpret and run. Then the command can be directly as

py ****. py

Use pip

py -2 -m pip 或 py -3 -m pip 

 Isn't it amazing! !

 

Guess you like

Origin blog.csdn.net/liushulin183/article/details/84372883