列出可用Python或路径: py.exe -0 or py -0p
PS C:\Users\yq\Downloads\test> py -0
-V:3.11 * Python 3.11 (64-bit)
-V:3.10 Python 3.10 (64-bit)
-V:3.9 Python 3.9 (64-bit)
-V:3.8 Python 3.8 (64-bit)
PS C:\Users\yq\Downloads\test> py -0p
-V:3.11 * C:\Program Files\Python311\python.exe
-V:3.10 C:\Users\yq\AppData\Local\Programs\Python\Python310\python.exe
-V:3.9 C:\Users\yq\AppData\Local\Programs\Python\Python39\python.exe
-V:3.8 C:\Users\yq\AppData\Local\Programs\Python\Python38\python.exe
创建虚拟环境
PS C:\Users\yq\Downloads> py -3.8 -m venv test
PS C:\Users\yq\Downloads> cd .\test\
PS C:\Users\yq\Downloads\test> .\Scripts\activate
(test) PS C:\Users\yq\Downloads\test> python.exe --version
Python 3.8.10
(test) PS C:\Users\yq\Downloads\test>
网友评论