In PowerShell, Get-Command python | fl * will tell you which Python executable it's finding and show you details about where it is.

  1. You can check Settings -> Apps and Features, or Control Panel -> Programs and Features. They will show you distinct versions of Python you installed, but that might not be enough if Python is installed as part of some other toolkit or program.
  2. If Python 2.7.11 is there, select it and click uninstall. If it's not there, see if you can tell what it's installed with, from the output of Get-Command earlier, and decide if you want to remove that.
  3. How PowerShell chooses what to run when you type a command is explained in help about_Command_Precedence, and is:
    1. Alias
    2. Function
    3. Cmdlet
    4. Native Windows commands

At the point of "Native Windows commands", it goes to the PATH environment variable, a semi-colon separated list of path names, which get searched in order, looking for a matching executable file.

You can see the folders with:

$Env:PATH -split ';'

And you can watch PowerShell identify what to run for 'python' with the command

Trace-Command –Name CommandDiscovery –Expression {get-command python} -PSHost

So, to make Python 2.7.13 the one to launch, you could:

  • make it the only Python version available.
  • move its folder to the front of the PATH list, ahead of any other version. See: What are path and other environment variables, and how can I set or use them - question on SuperUser.com
  • make a batch file to launch it called python.bat in a folder in the PATH ahead of other versions.
  • make an alias (in your PS Profile) named python to launch the one you want (New-Alias -name python -Value C:\Python27\python.exe , etc).
Answer from TessellatingHeckler on Stack Overflow
Top answer
1 of 3
32

In PowerShell, Get-Command python | fl * will tell you which Python executable it's finding and show you details about where it is.

  1. You can check Settings -> Apps and Features, or Control Panel -> Programs and Features. They will show you distinct versions of Python you installed, but that might not be enough if Python is installed as part of some other toolkit or program.
  2. If Python 2.7.11 is there, select it and click uninstall. If it's not there, see if you can tell what it's installed with, from the output of Get-Command earlier, and decide if you want to remove that.
  3. How PowerShell chooses what to run when you type a command is explained in help about_Command_Precedence, and is:
    1. Alias
    2. Function
    3. Cmdlet
    4. Native Windows commands

At the point of "Native Windows commands", it goes to the PATH environment variable, a semi-colon separated list of path names, which get searched in order, looking for a matching executable file.

You can see the folders with:

$Env:PATH -split ';'

And you can watch PowerShell identify what to run for 'python' with the command

Trace-Command –Name CommandDiscovery –Expression {get-command python} -PSHost

So, to make Python 2.7.13 the one to launch, you could:

  • make it the only Python version available.
  • move its folder to the front of the PATH list, ahead of any other version. See: What are path and other environment variables, and how can I set or use them - question on SuperUser.com
  • make a batch file to launch it called python.bat in a folder in the PATH ahead of other versions.
  • make an alias (in your PS Profile) named python to launch the one you want (New-Alias -name python -Value C:\Python27\python.exe , etc).
2 of 3
1

This was a question about python 2.7, but probably it will be useful to give an answer for the versions above 3.3 too:

Previously, multiple versions (also environments, also they are specific folders) of python on the same system was rare, and placing the only available python.exe directly in PATH was acceptable. Currently, multiple installed python versions will conflict and override each other if simply placed that way.
After 3.3 a python launcher was introduced which detects and activates one of the installed versions automatically. It is supposed to be placed in PATH instead of any python executable.

So in this modern situation, Get-Command python | fl * may give you nothing or nothing helpful.
And to run scripts or to get available versions, use launcher:

  • ensure you have it:
    try Get-Command py command from the PowerShell. If launcher is missing, it can be installed with the official installer. There is a separate checkbox for the launcher which is enabled by default.
  • if install is correct, command py --list-paths will give a summary on the installed versions, and supposed way to run scripts is not previous python main.py, but commands like py main.py or py -3.5 main.py. Run py --help for more info.

Additional confirmation that intended way changed.

Just to give an idea, launcher is not the only way to activate, this also can be done by a simple command.
For example, there is a version under D:\python_install\python.exe. But it's not in the PATH and python command correctly ends with not found error or opens Windows Store. An additional command in cmd or bat SET PATH=D:\python_install\;%PATH% or PowerShell $env:Path = "D:\python_install\;" + $env:Path temporarily activates that specific version, and python will work as previously during that specific run.

Discussions

Windows powershell starts old python
How many versions of python are installed on your machine? If there are multiple versions, check the PATH environment variable. Perhaps the paths to both version are present, with the newer version occurring later in the string>? That wouldn't be a PowerShell problem, though. More on learn.microsoft.com
🌐 learn.microsoft.com
3
0
July 18, 2023
Why doesn't python 3.10.0 show up on PowerShell?
Greetings, all I am excited to learn python, and have enrolled in a course to this effect. However, I started encountering problems right off the mark. I installed Python 3.10.0 from the Python homepage (it defaulted to the amd64 installer for Windows) and followed all the steps - disable the ... More on discuss.python.org
🌐 discuss.python.org
0
0
October 12, 2021
How can I check all the installed Python versions on Windows? - Stack Overflow
C:\Python310\python.exe ...ocal\Programs\Python\Python38\python.exe ... Just to add, this only works in the command prompt, not in the PowerShell terminal. 2023-10-17T14:36:26.863Z+00:00 ... For me, this doesn't list all of the versions installed compared to using py ... More on stackoverflow.com
🌐 stackoverflow.com
Switching between versions of python installed from microsoft store
So I installed python 3.9 and 3.7 from the microsoft store because I need both versions for certain projects, and I am wondering if it is possible to switch between which version of python I want my system to use. More on learn.microsoft.com
🌐 learn.microsoft.com
1
0
February 8, 2021
People also ask

How to check the Python version on CMD?
To check the Python version in Windows Command Prompt, open CMD and enter “python --versionorpython -V.” These commands will display the Python version that is installed on your system. Additionally, if you have multiple Python versions installed on your system, you may need to use the “python3 --version” command to display the installed version of Python 3.
🌐
superops.com
superops.com › superops blog › blog › how to check the python version?
How to check the Python version in quick and easy steps
What is a Python version file?
A Python version file is a simple text file that specifies which Python version should be used for a particular project or directory. The file contains a single line with a Python version specification like 3.13.1. It is usually used by Python version managers like pyenv, uv, and others to automatically select and activate the specified Python version whenever you work in that directory.
🌐
superops.com
superops.com › superops blog › blog › how to check the python version?
How to check the Python version in quick and easy steps
How do I check all my Python versions?
If you have multiple Python versions installed on your computer, and you want to check them all, follow these steps:\n1\n.\n For Windows users\n-Open Command Prompt or PowerShell and run the command “where python.”\n-This command will list all the python.exe paths found in directories listed in your system’s PATH environment variable.\n-After finding all Python executables or paths, you can check the version of each separately.\n-If you have Python Launcher installed on your system, run the command “py -0”\n-This prints all Python versions the launcher can detect.\n2. For Linux and MacOS users
🌐
superops.com
superops.com › superops blog › blog › how to check the python version?
How to check the Python version in quick and easy steps
🌐
How-To Geek
howtogeek.com › home › web › how to check the python version on windows, mac, and linux
How to Check the Python Version on Windows, Mac, and Linux
October 6, 2023 - To check the Python version on Windows, Mac, or Linux, type "python --version" into PowerShell on Windows, or the Terminal on Linux or Mac.
🌐
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 - Open Command Prompt or PowerShell and run: where python · This lists all the python.exe files that your system knows about. If you have the Python launcher installed (and you probably do), try this gem: py -0 · This gives you a neat list like: -3.11-64 -3.10-64 -2.7-32 · Handy, right? It even shows 32-bit vs. 64-bit versions.
🌐
YouTube
youtube.com › codeshift
how to check python version in powershell - YouTube
Instantly Download or Run the code at https://codegive.com title: checking python version in powershell - a step-by-step tutorialintroduction:python is a ve...
Published   March 16, 2024
Views   71
🌐
Finxter
blog.finxter.com › home › learn python blog › check python version: a simple illustrated guide
Check Python Version: A Simple Illustrated Guide - Be on the Right Side of Change
March 9, 2024 - In the search box, type “powershell”. Press enter. ... The Python version appears in the next line below your command.
Find elsewhere
🌐
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 - If you have multiple Python versions installed on your computer, and you want to check them all, follow these steps: 1. For Windows users · -Open Command Prompt or PowerShell and run the command “where python.” · -This command will list ...
🌐
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
🌐
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 - Windows installations do not come with Python preinstalled. However, if you have used Python before but don't remember which version, you can easily check which version is installed. Open Windows PowerShell or the Command Prompt, and run the following command:
🌐
GitHub
github.com › HealthCatalyst › PythonPowershellUtilities
GitHub - HealthCatalyst/PythonPowershellUtilities: The only powershell module you should ever need. · GitHub
A powershell module for installing python versions and managing python virtual environments - on windows. There are several good tools available for managing python installations and virtual environments for *nix. This module aims to take the best ideas from those tools and create a tool that ...
Starred by 10 users
Forked by 2 users
Languages   PowerShell
🌐
MiniTool Partition Wizard
partitionwizard.com › home › partition magic › check python version on windows/mac/linux [guide]
Check Python Version on Windows/Mac/Linux [Guide] - MiniTool Partition Wizard
July 19, 2023 - Well, this post tells you how to perform a Python version check on operating systems like Windows, mac, and Linux respectively. Step 1: Right-click on the Windows icon on the desktop and click Windows PowerShell.
🌐
Microsoft Learn
learn.microsoft.com › en-us › answers › questions › 1332563 › windows-powershell-starts-old-python
Windows powershell starts old python - Microsoft Q&A
July 18, 2023 - Hello together, this is what I get if I try to start my new installed python 3.11.4: PS C:\Users\XXX> python Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 19:29:22) [MSC v.1916 32 bit (Intel)] on win32 Type "help",…
🌐
Python.org
discuss.python.org › python help
Why doesn't python 3.10.0 show up on PowerShell? - Python Help - Discussions on Python.org
October 12, 2021 - Greetings, all I am excited to learn python, and have enrolled in a course to this effect. However, I started encountering problems right off the mark. I installed Python 3.10.0 from the Python homepage (it defaulted t…
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
🌐
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
Run pyenv install -l to check a list of Python versions supported by pyenv-win · Run pyenv install <version> to install the supported version · Run pyenv global <version> to set a Python version as the global version ·
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%
🌐
datagy
datagy.io › home › python posts › how to check your python version (windows, macos, linux)
How to Check Your Python Version (Windows, macOS, Linux) • datagy
March 26, 2022 - Over the following sections, you’ll learn how to check your Python version using Windows 10, Windows 7, macOS, and Linux. In Windows 10, we can use the PowerShell to check the version of Python that we are running.
🌐
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.
🌐
Psychz
psychz.net › client › question › en › how-to-check-python-version-in-windows-.html
How to check Python version in Windows? ...
Today, there are two active versions of Python: Python 2 and Python 3, of which Python 2 is no longer supported from January 2020. Open Windows Powershell, and enter the following command:
Call   800-933-1517
Address   611 Wilshire Blvd #300, 90017, Los Angeles,
🌐
Scaler
scaler.com › home › topics › how to check python version?
How to Check Python Version ? - Scaler Topics
January 5, 2024 - In Windows operating systems, we can use the command python --version to check the python version. We just need to open the Windows command prompt, or Windows Powershell, and enter the command.