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
33

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
Perhaps the paths to both version ... newer version occurring later in the string>? That wouldn't be a PowerShell problem, though. It's just the way shells work. ... Thank you for your question and for reaching out with your question today. Based on the information provided, it seems like you have both Python 3.11.4 and Python 3.7.4 installed on your system, and when you run the python command in PowerShell, ... 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
6
0
October 12, 2021
Powershell script to check if Python is installed - Stack Overflow
I'm trying to check if Python is installed on a machine via a Powershell script. ... If the command executes correctly (check the Exitcode on $p property), read the output and extract the version number. More on stackoverflow.com
🌐 stackoverflow.com
Installing python 3.8 but getting 2.7 in CMD/Powershell?
Go to windows add/remove programs, any python you find there, uninstall it. Then when you have no more python left in the system... running python returns error not found. only then install 3.8. More on reddit.com
🌐 r/learnpython
16
2
July 10, 2020
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 --versioncommand 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 change the Python version?
To change the default Python version, follow these steps:\n1. On Windows\n-Search "Edit the system environment variables" in Start and open it.\n-A “System Properties” dialog box will appear. Click on “Environment Variables.”\n-Edit the Path variable in "User variables." \n-Move the path of your desired Python version to the top of the list.\n-Click OK to save, then start Command Prompt.\n-Verify the version using the “python --version” command.\n2\n.\n On Linux/MacOS\nTo switch the default Python, you can update the Python symlink to the version you want to use, but this can affect system too
🌐
superops.com
superops.com › superops blog › blog › how to check the python version?
How to check the Python version in quick and easy steps
🌐
SuperOps
superops.com › superops blog › blog › how to check the python version?
How to check the Python version in quick and easy steps
1 day 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 ...
🌐
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.
🌐
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. To view the Python 3 version, run "Python3 --version" instead.
🌐
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 - Move the new Python 3.11.x path (like C:\Python311) above any old version path. Restart PowerShell and run python --version to confirm.
Find elsewhere
🌐
DataCamp
datacamp.com › tutorial › check-python-version
How to Check Python Version: Windows, macOS, and Linux | DataCamp
January 28, 2026 - The most common way to check your Python version is by using your computer's terminal (Mac/Linux) or Command Prompt/PowerShell (Windows).
🌐
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.
🌐
Linux Hint
linuxhint.com › check-python-version-windows
How to Check Python Version in Windows – Linux Hint
Step 1: Open Windows PowerShell Firstly, utilize the “Window+X” combined key to open the power user menu. After then, select the “Windows PowerShell (Admin)” option to open PowerShell as an administrator user: Step 2: Check Python Version Simply run the “python –version” command ...
🌐
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 - However, if you still use Python ... from the command to check which Python 2 version you have installed: ... 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 ...
🌐
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 - Because accessing the command line prompt or terminal varies from system to system, this part of the tutorial is split across the different operating systems available to you. 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 ...
🌐
Finxter
blog.finxter.com › home › learn python blog › check python version from command line and in script
Check Python Version from Command Line and in Script - Be on the Right Side of Change
August 17, 2023 - Open PowerShell by pressing Win+R, typing powershell, and then pressing Enter. Once PowerShell is open, type the following command: ... This command will return the Python version installed on your Windows system.
🌐
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.
🌐
Hero Vired
herovired.com › learning-hub › topics › how-to-check-python-version
How to Check Python Version in CMD?
February 10, 2025 - Checking the Python version using this PowerShell is easy. To check the Python version, follow the below steps: 1. Open the PowerShell (use Win + X) and select Windows PowerShell or Windows PowerShell (Admin) ... Using the Windows terminal or command line, you can also check the Python version.
🌐
Psychz
psychz.net › client › question › en › how-to-check-python-version-in-windows-.html
How to check Python version in Windows? ...
July 14, 2021 - When using Python, it is essential to know which version an application requires and which version you have. 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,
🌐
Wikihow
wikihow.com › computers and electronics › software › programming › python › how to check python version on mac, pc, linux: guide + fixes
How to Check Python Version on Mac, PC, Linux: Guide + Fixes
March 2, 2025 - Do you need to find out which version of the Python interpreter is installed on your PC or Mac? Whether you're using Windows, macOS, or Linux, you can easily check your version of Python using the command python --version in PowerShell or ...
🌐
Guru99
guru99.com › home › python › how to check python version on linux, mac & windows
How to Check Python Version on Linux, Mac & Windows
August 12, 2024 - Step 2) When the command prompt ... get the version name of Python. ... Note: Before running the command, ensure that Python is pre-installed on the computer. Alternatively, open a command line and type the below command: ... Open the power shell prompt by typing PowerShell in the start ...
🌐
Microsoft Learn
learn.microsoft.com › en-us › windows › python › beginners
Python on Windows for beginners | Microsoft Learn
Install Python 3.13: Install Python 3 from the Microsoft Store. The Microsoft Store version automatically configures your PATH and provides automatic updates. Once installed, open PowerShell and run python --version to verify.