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

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

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

To install a Python version that is not listed there run py install followed by the version number, e.g. py install 3.14

Answer from Vespene Gas on Stack Overflow
Top answer
1 of 7
207

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

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

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

To install a Python version that is not listed there run py install followed by the version number, e.g. py install 3.14

2 of 7
28

In cmd run:

py --list

My result (all versions of python intalled):

 -V:3.11 *        Python 3.11 (64-bit)
 -V:3.9
 -V:3.8           Python 3.8 (64-bit)
 -V:3.6           Python 3.6 (64-bit)
 -V:3.5
 -V:ContinuumAnalytics/Anaconda39-64 Anaconda py39_4.12.0
🌐
Webucator
webucator.com › catalog › programming › python
How to find all your Python installations on Windows (and Mac) | Webucator
C:\> Get-ChildItem -Path C:\ -Filter site.py -Recurse -ErrorAction SilentlyContinue -Force Directory: C:\Program Files\MySQL\MySQL Workbench 8.0 CE\python\lib Mode LastWriteTime Length Name ---- ------------- ------ ---- -a--- 9/16/2017 7:38 PM 19168 site.py Directory: C:\Users\ndunn\AppData\Local\Programs\Python\Python38\Lib Mode LastWriteTime Length Name ---- ------------- ------ ---- -a--- 9/7/2020 11:16 PM 21963 site.py Directory: C:\Users\ndunn\AppData\Local\Programs\Python\Python39\Lib Mode LastWriteTime Length Name ---- ------------- ------ ---- -a--- 6/28/2021 4:06 PM 22207 site.py
Discussions

Managing multiple python versions on Windows
Use the py launcher, if you run ‘py -0’ you should get a list of the pythons installed, you can select the one you want to use by doing ‘py -3.10 main.py’ , ‘py -3.13 -m pip install …’ and so on More on reddit.com
🌐 r/learnpython
7
6
March 18, 2025
How to list down all available python versions in my windows - Stack Overflow
When I type py --list in my cmd, it shows C:\Users\Administrator>py --list Installed Pythons found by py Launcher for Windows -3.9-64 * -3.8-64 But when I use the command python it shows Pyth... More on stackoverflow.com
🌐 stackoverflow.com
windows - How to list all Python versions installed in the system? - Stack Overflow
I need to present the user a list of Python installations to choose from for executing something. I suppose in Windows I could get this information from registry. Don't know about Linux and Mac. ... More on stackoverflow.com
🌐 stackoverflow.com
Which version of Python do I have installed? - Stack Overflow
Simply open the command prompt ... give you all necessary information regarding versions: ... This is practically identical to poy's answer. 2019-11-24T16:48:35.907Z+00:00 ... This actually took me to the MS Store for Python. 2022-05-20T13:15:06.833Z+00:00 ... I have Python 3.7.0 on Windows ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
Medium
medium.com › @akhshyganesh › find-all-python-versions-on-your-system-like-a-pro-2c4d10650035
Find All Python Versions on Your System Like a Pro | by Akhshy Ganesh | Medium
June 12, 2025 - In this quick guide, I’ll walk you through how to track down every sneaky little Python version hiding on your machine. Whether you’re on Windows, macOS, or Linux — we’ve got you covered. Over time, you’ve probably installed Python for different projects. One for data science, one for that Flask API you built last year, and maybe another one by accident when installing VS Code. It’s normal. It’s Pythonic. But you need to know what’s where to avoid chaos. ... This lists all the python.exe files that your system knows about.
🌐
Reddit
reddit.com › r/learnpython › managing multiple python versions on windows
r/learnpython on Reddit: Managing multiple python versions on Windows
March 18, 2025 -

I've coded a bit in Python for years, and had an existing installation of 3.10.7 which I installed using Chocolatey some time ago.

Then I thought I would play with WhisperX. The tutorial I found walked me through installing Anaconda, which I did not realize would install a second copy of Python, this time 3.12. It broke a couple of existing projects, and so I gave up on WhisperX and swapped the PATH variable back to the 3.10 installation.

Then, last week, I read about Gemma3 and thought I might experiment with that. I found a blog post -- can you see where this is going? -- that pointed me to Ollama. Which I installed, once again not realizing it would install yet another copy of Python, this time 3.13. It didn't break my projects this time, but I think that's because the user-level PATH variable is still pointing at 3.10 while the system-level PATH variable is pointing at 3.13. Oh, and I never got Gemma3 up and running, possibly because it doesn't like 3.10.

So now I have three copies of Python installed, they're fighting with one another over the PATH variable, and I still haven't gotten to experiment with local AI stuff. There's got to be a better way to manage these things.

My googling so far has pointed me at pyenv, which as far as I can tell is a Linux-only utility. I think. I love me some Linux, but the machine in question is a Windows box. Is there some obvious utility I should be using for swapping back and forth between versions that I'm just not finding?

🌐
Alma Better
almabetter.com › bytes › articles › how-to-check-python-version
How to Check Python Version? (Linux, Windows and Mac)
January 12, 2024 - Learn how to check Python version on Windows, Linux and Mac OS. Explore different types of Python versions and essential commands to check Python versions.
🌐
YouTube
youtube.com › watch
How to Check and List All Python Versions Installed on System - YouTube
In this tutorial we will see how to check and find all python versions installed on your windows system
Published   April 3, 2024
🌐
CyberPanel
cyberpanel.net › blog › how-to-check-python-version
Quick Ways to Check Python Version on Mac, Windows & Linux
September 23, 2025 - And if you’re looking to build advanced projects but don’t want to manage everything yourself, you can always hire a Python developer to handle the setup and development efficiently. In the Command Prompt, type py -0. All installed Python ...
Find elsewhere
🌐
HPE Developer
developer.hpe.com › blog › managing-multiple-instances-of-python-in-microsoft-windows
Managing Multiple Instances of Python in Microsoft Windows | HPE Developer Portal
April 6, 2021 - There's also a -0p option to list both the version and pathname of the python.exe instances it can use: C:\Temp>py -0p Installed Pythons found by py Launcher for Windows -3.9-64 C:\Program Files\Python39\python.exe * -3.8-32 C:\Users\Larvoire\AppData\Local\Programs\Python\Python38-32\python.exe -3.7-64 C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\python.exe -3.6-64 C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\python.exe -3.5-64 C:\Program Files\Python35\python.exe -2.7-64 C:\Program Files\Python27\python.exe C:\Temp>
🌐
PhoenixNAP
phoenixnap.com › home › kb › sysadmin › how to check python version in linux, windows, and macos
How to Check Python Version in Windows, Linux, and macOS
December 19, 2025 - Open Windows PowerShell or the Command Prompt, and run the following command: ... If you have Python installed, PowerShell reports the version number. If you are using a Mac, check the Python version by running the following command in the terminal: ... The system reports the installed version. Python 2 and Python 3 are separate programs, allowing ...
🌐
freeCodeCamp
freecodecamp.org › news › check-python-version-how-to-check-py-in-mac-windows-and-linux
Check Python Version – How to Check Py in Mac, Windows, and Linux
July 7, 2023 - This will launch the IDLE Python Shell, which will display the Python version information at the top. For example, "Python 3.9.2 (tags/v3.9.2:1a79785, Feb 22 2021, 12:26:58)". To exit the IDLE Python Shell, you can go to the "File" menu and choose "Exit" or simply close the window.
Top answer
1 of 3
4

I'm writing a Python IDE and I want to let user to choose the interpreter for executing the program.

Just do it like other IDEs then and simply supply a dialog where users can add interpreters they want to be able to run the code with.

Eclipse does this for example for Java Runtimes, and it’s perfectly fine to have it like that. Especially for languages like Python where virtual environments are an important thing which each have their own exectutable.

You certainly can come up with a one-time detection that checks some common locations. For Windows, this would obviously be the registry, as the py.exe launcher requires the interpreters to be registered there—at least the system-wide ones. On Unix machines, you could check the common bin/ folders, most prominently /usr/local/bin/ which is the standard location where Python installs itself. You could also check the PATH for Python executables. But all those things should be considered carefully and only offer an initial setup. There are always edge cases where a user didn’t do the “standard thing” where your detection will fail. For example I don’t have my Python interpreters in my path, and a linux server I access I have installed Python into a non-standard folder in my home directory. And finally, just because it looks like Python doesn’t mean it is Python.

Yes, you can do some guesswork to come up with an initial set of interpreters, but really don’t spend too much time on it. In the end, you won’t be able to detect everything perfectly anyway. And you will miss virtual environments—which might be very crucial to the project the user is working on in your IDE.

So instead of wasting time on bad detection, spend more time on creating a manual dialog to register interpreters. You will need that anyway, and a good interface can make it very easy—even for beginners—to use it.

2 of 3
0

Not sure this is entirely possible, but here's a dirty fix:

from subprocess import *
from time import sleep

for i in range(2, 4):
    x = Popen('python' + str(i) + ' --version', shell=True, stdout=PIPE, stdin=PIPE, stderr=STDOUT)
    while x.poll() == None:
        sleep(0.025)
    print('Exit code of ' + str(i) + ' is:',x.poll())
    x.stdout.close()
    x.stdin.close()

The exit code will tell you if Python2 or Python3 is installed. You could add a second iterator for python versions 2.4, 2.4, 3.1, 3.2 etc etc. Or just keep them in a list, whichever you prefer for this already dirty fix.

🌐
GUVI
guvi.in › blog › python › how to check python version in cmd (windows command prompt)
How to Check Python Version in CMD on Windows Easily
January 29, 2026 - This default may differ from the interpreter returned by the python command. ... The Python Launcher can list every Python version detected on the system, including multiple major and minor releases and their architectures.
🌐
Finxter
blog.finxter.com › how-to-check-your-python-version
Check Python Version: A Simple Illustrated Guide – Be on the Right Side of Change
March 9, 2024 - Windows: Hit shortcut Win+R, type powershell, hit OK. MacOS: Hit shortcut Cmd+Space, type terminal, hit OK. Linux: Hit shortcut Ctrl+Alt+T. The Python version output consists of three numbers major:minor:micro. For example, version 3.7.2 means that ... 🤚 ATTENTION: Different major versions ...
🌐
SuperOps
superops.com › superops blog › blog › how to check the python version?
How to check the Python version in quick and easy steps
4 days ago - To check the Python version in Windows Command Prompt, open CMD and enter “python --version ” or “python -V.” These commands will display the Python version that is installed on your system.
🌐
Note.nkmk.me
note.nkmk.me › home › python
Check Python Version on Command Line and in Scripts | note.nkmk.me
April 23, 2025 - Run the python or python3 command with the --version or -V option in the Command Prompt (cmd) on Windows or the Terminal on macOS and Linux.
🌐
GeeksforGeeks
geeksforgeeks.org › python › check-the-version-of-the-python-interpreter
How to check Python Version : Windows, Linux and Mac - GeeksforGeeks
December 17, 2025 - Open the Command Prompt for Windows by searching for "cmd" in the Windows Start menu, or open Terminal for Mac by searching "terminal" in the macOS spotlight search. Then, use one of the following commands: ... We can also find the Python version in the interactive shell.
🌐
GitHub
github.com › pyenv-win › pyenv-win
GitHub - pyenv-win/pyenv-win: pyenv for Windows. pyenv is a simple python version management tool. It lets you easily switch between multiple versions of Python. It's simple, unobtrusive, and follows the UNIX tradition of single-purpose tools that do one thing well. · GitHub
> python -c "import sys; print(sys.executable)" \path\to\.pyenv\pyenv-win\versions\<version>\python.exe · commands List all available pyenv commands local Set or show the local application-specific Python version latest Print the latest installed or known version with the given prefix global Set or show the global Python version shell Set or show the shell-specific Python version install Install 1 or more versions of Python uninstall Uninstall 1 or more versions of Python update Update the cached version DB rehash Rehash pyenv shims (run this after switching Python versions) vname Show the cu
Starred by 7.1K users
Forked by 570 users
Languages   VBScript 53.7% | Python 30.9% | Batchfile 11.6% | PowerShell 3.7% | Shell 0.1%