Win7已经安装了2个不同版本的Python,Python2.7 和Python3.7。
并且都已加入到了PATH环境变量。
PATH值
D:\projects\php>PATH
PATH=C:\Python27\;C:\Python27\Scripts;C:\Program Files (x86)\Common Files\Oracle
\Java\javapath;C:\Program Files (x86)\Python37-32\Scripts\;C:\Program Files (x86
)\Python37-32\;C:\Program Files (x86)\NetSarang\Xshell 6\;C:\Windows\system32;C:
\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;D:
\PHP73;C:\Program Files\PuTTY\;C:\ProgramData\ComposerSetup\bin;C:\Program Files
\Git\cmd;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\bin;C:\Program Files
\MySQL\MySQL Shell 8.0\bin\;C:\Users\Administrator\AppData\Roaming\Composer\vend
or\bin;C:\Users\Administrator\AppData\Roaming\npm
D:\projects\php>
调用Python3
D:\projects\php>py -3
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Inte
l)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
调用Python2
D:\projects\php>py -2
Python 2.7.16 (v2.7.16:413a49145e, Mar 4 2019, 01:37:19) [MSC v.1500 64 bit (AM
D64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>