且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 Windows 上检查所有已安装的 Python 版本?

更新时间:2023-11-26 21:22:46

我刚刚得到答案.通过输入py -h"或py --help",我得到了帮助信息:

I just got the answer. By typing "py -h" or "py --help" I got the help message:

C:\Users\admin>py -h
Python Launcher for Windows Version 3.7.1150.1013

usage:
py [launcher-args] [python-args] script [script-args]

Launcher arguments:

-2     : Launch the latest Python 2.x version
-3     : Launch the latest Python 3.x version
-X.Y   : Launch the specified Python version
     The above all default to 64 bit if a matching 64 bit python is present.
-X.Y-32: Launch the specified 32bit Python version
-X-32  : Launch the latest 32bit Python X version
-X.Y-64: Launch the specified 64bit Python version
-X-64  : Launch the latest 64bit Python X version
-0  --list       : List the available pythons
-0p --list-paths : List with paths

这告诉我-0"(零,不是字母O")列出了可用的蟒蛇:

Which tells me that "-0" (zero, not letter "O") lists the available pythons:

C:\Users\admin>py -0
Installed Pythons found by py Launcher for Windows
 -3.7-64 *
 -3.7-32
 -2.7-64
 -2.7-32

虽然-0p"不仅列出了版本,还列出了路径:

While "-0p" lists not only the versions, but also the paths:

C:\Users\admin>py -0p
Installed Pythons found by py Launcher for Windows
 -3.7-64        C:\Users\admin\AppData\Local\Programs\Python\Python37\python.exe *
 -3.7-32        C:\Users\admin\AppData\Local\Programs\Python\Python37-32\python.exe
 -2.7-64        C:\Python27_64\python.exe
 -2.7-32        C:\Python27_32\python.exe