Check Python version in Windows CMD: quick guide to installers and py launcher

Open Command Prompt, type python --version and press Enter; Windows prints a line such as Python 3.14.0 with the version of the Python that the python command runs.

This guide covers the py launcher and the newer Python install manager, how to see every installed version, which installer to pick, and how to fix a python command that prints nothing or opens the Microsoft Store.

Method 1: Basic command

The --version switch (short form -V) is built into the Python interpreter itself. It prints the version number and exits without opening the interactive prompt.

  1. Select Start, type cmd and open Command Prompt.
  2. Type python --version and press Enter.
  3. Read the output line, which starts with Python followed by the major, minor and patch numbers.
  4. If the line is missing or Windows says the command is not recognized, type py list and press Enter instead (Method 2).

The number belongs to whichever Python the python command resolves to in that window. If several versions are installed, or a virtual environment is active, another Python may answer than the one you expected.

Why a simple Python version check matters

Windows does not ship a system copy of Python, so every version on a PC was added by you, an installer or another tool. Several can sit side by side, and each one has its own packages.

What depends on the version Why it matters
Script syntax and standard library Code written for a newer release can fail on an older interpreter
Packages installed with pip Each Python keeps its own packages, so a package installed for one version is missing in another
Windows support Python 3.15 supports Windows 10 and newer; Windows 8.1 needs Python 3.12 and Windows 7 needs Python 3.8
Which installer you used The Python install manager, the deprecated full installer and the Microsoft Store all put Python in different places
Bug reports and support Maintainers ask for the exact version before they can reproduce a problem

Python releases only support a Windows version while Microsoft still gives it extended support. If you are unsure which Windows you run, check your Windows version before you pick a Python release.

How to check Python version in Windows CMD — detailed steps

Each route below works in Command Prompt, Windows PowerShell and Windows Terminal. Pick the one that matches what you need to know.

Your situation Use this What it shows
You want one version number fast python --version (Method 1) The version of the default python command
python is not recognized or you have several versions py list (Method 2) Every installed runtime and the default one
You are already at a >>> prompt or want build details The interactive banner (Method 3) Version, build date and compiler
A script must check the version itself sys.version_info (Method 4) Major, minor and micro numbers your code can compare

Method 2: If python is not recognized: use the Python launcher

The py command comes from the Python install manager, which replaced the older Python launcher for Windows. The old launcher has been deprecated since Python 3.14, but both answer to py.

  1. Open Command Prompt.
  2. Type py list and press Enter to see every installed Python runtime.
  3. Type py list --one and press Enter to see only the runtime that py launches by default.
  4. On a PC that still has the old Python launcher, type py --list or py -0p instead; both legacy forms are still accepted by the install manager.
  5. Type py on its own and press Enter to open the default interpreter; its first line shows the version.

If Command Prompt answers 'py' is not recognized as an internal or external command, neither the install manager nor the old launcher is installed. Install Python from the command line first, then run the check again.

Check Python version in Windows CMD: quick guide to installers and py launcher
py list shows every installed runtime with its tag, name, version and aliases, including Store copies it cannot update. (Image: Microsoft)

Method 3: Check the interactive shell banner

When the interpreter starts, it prints the same build string that sys.version holds: the version number, the build date and the compiler used.

  1. Open Command Prompt.
  2. Type python (or py) and press Enter.
  3. Read the first line of the banner, which begins with Python and the version number.
  4. Type quit() and press Enter to return to Command Prompt.

To get the same detail without opening the prompt, run python -VV. Passing the version switch twice adds the build information to the output.

Method 4: Verify the version programmatically

The Python documentation advises against parsing sys.version. Use sys.version_info or the platform module when code needs the number.

  1. Open Command Prompt.
  2. Type python -c "import sys; print(sys.version_info)" and press Enter to see the major, minor, micro, release level and serial values.
  3. Type python -c "import platform; print(platform.python_version())" and press Enter to get a plain major.minor.patchlevel string.
  4. In a script, compare the tuple directly, for example if sys.version_info < (3, 12):, and stop with a clear message when the interpreter is too old.

platform.python_version() always includes the patch level, so it prints 3.14.0 rather than 3.14 for a first release.

Advanced checks and context

A version number alone does not tell you which copy of Python answered. These one-line checks fill in the rest.

Command What it tells you
python -VV Version plus build date and compiler
python -c "import sys; print(sys.executable)" Full path of the python.exe that ran the command
python -c "import sys; print(sys.prefix, sys.base_prefix)" Different paths mean a virtual environment is active
python -c "import sys; print(sys.maxsize > 2**32)" True for a 64-bit interpreter, False for 32-bit
python -c "import sys; print(sys.winver)" The major.minor value Windows uses for this install's registry keys
py list All runtimes the install manager can see, with the default

Inspecting the executable path and build type

Two Pythons can report the same version but behave differently because they live in different folders or use a different build. Check the path first, then the build.

  1. Type where python and press Enter to list every python.exe that Windows finds in the current folder and the folders on PATH, in search order.
  2. Treat the first line as the copy that python runs; a path under \Microsoft\WindowsApps\ is an app execution alias, not the interpreter itself.
  3. Type py list --format=exe and press Enter to print the executable path of each runtime the install manager knows about.
  4. Type python -VV and press Enter to see the build string for the copy that answers.
  5. Look for a t after the version in py list, such as 3.15t; that tag marks a free-threaded build.

Using the py launcher to target specific versions

py accepts a version tag before any other argument, so you can run one exact Python without changing PATH.

  1. Type py list and press Enter to see the tags you can use, such as 3.14 or 3.13.
  2. Run a script with one version: py -V:3.13 myscript.py. For official releases the V: can be dropped, so py -3.13 myscript.py does the same.
  3. Pick an architecture with the full tag, for example py -V:3-arm64.
  4. Install packages for that version only: py -3.13 -m pip install SomePackage.
  5. Add a shebang line such as #! python3 at the top of a script so py myscript.py picks the version the script asks for.

An active virtual environment wins when you do not name a version and the script has no shebang line. Deactivate it, or name a version, to reach a global install.

Multiple-install strategies and version management

The Python install manager is built for several runtimes on one PC. Its py subcommands replace manual installs and PATH edits.

Task Command or setting Notes
Add a version py install 3.13 Runtimes install per user
Update managed versions py install --update Replaces a runtime only when a newer release exists; site-packages and virtual environments stay
Remove a version py uninstall 3.13 Add --yes to skip the confirmation prompt
Pick the default PYTHON_MANAGER_DEFAULT environment variable or the default_tag setting py list then shows the new default
See what can be installed py list --online Searches the online index
Isolate one project python -m venv .venv, then .venv\Scripts\activate The environment's Python answers python while it is active

The best practice for developers and admins is one virtual environment per project, which keeps package versions apart. Admins rolling Python out to many PCs can use pymanager in scripts, because that name is less likely to clash with an old launcher than py.

When to use which Python installer or manager

Your situation Use this Why
New install on Windows 10 or 11 Python install manager (Microsoft Store or python.org) Gives python, py and pymanager, and updates itself
Scripted install winget install 9NQ7512CXL7T -e Installs the same install manager without the Store app
Windows Server 2019 or tools that cannot install MSIX The MSI from python.org/downloads Windows Server 2019 is the one supported Windows without MSIX
Existing full-installer setup Keep it, plan a move The full installer is deprecated since 3.14 and will not be produced for 3.16 or later
App that bundles its own Python Embeddable package A minimal, isolated copy with no pip or IDLE
Build servers nuget.org packages A reduced Python for CI without a system install
Data science with conda Anaconda Ships numpy, scipy and pandas, but is not supported by the core Python team

The Microsoft Store and python.org copies of the install manager are identical. Uninstalling the install manager does not remove the Python runtimes it installed.

Python install manager in the Microsoft Store from the Python Software Foundation
The Store and python.org builds of the install manager are identical, and both give you python, py and pymanager. (Image: Microsoft)

Troubleshooting common problems and their fixes

`py` reports a "can't open file" error

The legacy Python launcher is installed and takes priority over the install manager.

  1. Select Start and open Installed apps.
  2. Search for Python launcher.
  3. Select it and choose Uninstall.
  4. Open a new Command Prompt and run py list again.

`pythonw` or `pyw` start a different version than `python` or `py`

The windowed aliases point somewhere else.

  1. Select Start, type Manage app execution aliases and open it.
  2. Make the pythonw.exe and pyw.exe aliases match the python.exe and py.exe ones.
  3. Open a new terminal and test again.

Old py.ini settings no longer work

The Python install manager ignores py.ini.

  1. Move the default version into the PYTHON_MANAGER_DEFAULT environment variable or a configuration file.
  2. Run py list to confirm the default changed.

Typing a script name opens it in a new window

This is a known Windows limitation with the install manager.

  1. Run the script as py script-name.py instead.
  2. Or create a batch file with the same name that contains @py "%~dpn0.py" %*.

Problem: python –version returns an error or nothing

"'python' is not recognized as an internal or external command"

No Python is installed, or its folder is not on PATH.

  1. Run py list. If it lists a runtime, use py or add %LocalAppData%\Python\bin to PATH for the python aliases.
  2. Select Start, search for Edit environment variables for your account and add the folder to your user Path.
  3. Close every terminal, open a new one and run python --version again.

`python` opens the Microsoft Store or prints nothing

An app execution alias is answering instead of an installed interpreter.

  1. Install the Python install manager if it is not installed yet.
  2. Select Start and open Manage app execution aliases.
  3. Check that the Python (default) aliases are turned on; if they already are, turn them off and on again.
  4. Make sure your PATH still contains %UserProfile%\AppData\Local\Microsoft\WindowsApps.
  5. Open a new terminal and run python --version.

Problem: I have multiple Python versions and don't know which one will run

`python` and `py` launch different versions

An older installer added its own folder to PATH ahead of the install manager.

  1. Run where python to see which python.exe comes first.
  2. Open Installed apps, find the older Python runtime and either remove it or choose Modify and clear its PATH options.
  3. Open Manage app execution aliases and set the python.exe alias to Python (default).
  4. Run python --version and py list --one and compare the results.

Neither command runs the version you expect

A default tag, a prerelease or an unmanaged install is being chosen first.

  1. Check the PYTHON_MANAGER_DEFAULT environment variable.
  2. Install the version you want with py install 3.14 so the manager owns it; managed installs win over unmanaged ones.
  3. Uninstall a prerelease that is not managed by the install manager and reinstall it with py install.
Python installer Advanced Options with Add Python to environment variables unchecked
Choose Modify on an older full install and leave this box clear so its folder stops coming first on PATH. (Image: docs.python.org)

Problem: pip installs packages into a different Python

A package installs but `import` fails

The pip command belongs to another Python than the one running your code.

  1. Run pip through the interpreter you checked: python -m pip install SomePackage.
  2. For one specific version, use py -3.14 -m pip install SomePackage.
  3. Inside a project, activate its environment with .venv\Scripts\activate before installing.

"pip" or a package command is not recognized

The install manager does not create global shortcuts for new packages automatically.

  1. Use python -m pip instead of pip.
  2. Run py install --refresh to rebuild the global shortcuts.
  3. Add the global shortcuts folder to PATH if the command output says it is missing.

Step-by-step recovery when version checks fail

Work through these in order when neither python nor py gives a sensible answer. Stop at the first step that fixes it.

  1. Run py list to see whether any runtime is installed at all.
  2. If nothing is listed, install the Python install manager from the Microsoft Store or python.org.
  3. Open Manage app execution aliases and turn the Python (default) and Python install manager aliases off and on again.
  4. Uninstall Python launcher from Installed apps if py reports "can't open file".
  5. Run py install --refresh to recreate Start menu shortcuts, registry keys and global aliases.
  6. Close all terminals, open a new Command Prompt and run python --version again.
  7. If it still fails, look for log files in your %TEMP% folder and include them in a report on the Python bug tracker.
Python install manager configuration helper pointing to Manage app execution aliases
On first launch the helper offers to open Settings so you can enable the Python (default) and Python install manager aliases. (Image: Microsoft)

Security and permission notes

Point What to know
Admin rights The install manager installs runtimes per user and needs no administrator account; an all-users full install asks for admin approval
Where to get Python Use the Microsoft Store or python.org/downloads; the two install manager builds are identical
App execution aliases Windows decides what python and py start through Manage app execution aliases; check them after every Python install or removal
Tampered package index Admins can require signed index files so the install manager rejects a modified feed
Long paths Turning on Enable Win32 long paths is an admin-level policy change, not a Python setting
Python app execution aliases for python.exe and python3.exe in Windows 11 Settings
Each command name has its own On or Off switch, so check this list after every Python install or removal. (Image: Microsoft Q&A)

Risks and edge case behavior for Python version checks

Edge case What happens How to handle it
Virtual environment active python reports the environment's version Check sys.prefix against sys.base_prefix
python3 typed out of habit The install manager includes a python3 command that mimics python Use python or py; python3 is not the recommended form
No runtime installed yet The first python or py call can install the latest release automatically Run py list first if you only want to look
Script with a shebang line py follows the line, not your default Read the first line of the script
Free-threaded build Shows as a t tag such as 3.15t Call it with py -V:3.15t

Quick reference: Python version commands cheat sheet

Command Result
python --version or python -V Version of the default python
python -VV Version with build details
py list All installed runtimes
py list --one The default runtime
py --list or py -0p Legacy launcher listing, with paths for -0p
py -3.13 script.py Run one specific version
where python Every python.exe on PATH
python -c "import sys; print(sys.executable)" Path of the running interpreter
py -3.13 -m pip install SomePackage Install a package for one version

Python version check FAQ

How do I check the Python version in CMD?

Open Command Prompt, type python –version and press Enter. The output line starts with Python and the version number. If the command is not recognized, run py list to see every runtime the Python install manager or launcher can find.

What is py.exe?

py.exe is the command that picks and starts a Python version on Windows. It now comes with the Python install manager, which replaced the older Python launcher for Windows. Run py list to see installed versions, or py -3.13 to run one of them.

Why does running python.exe open the Microsoft Store?

The python command opens the Microsoft Store app when the Python install manager is missing or its aliases are off. Install the install manager, then open Manage app execution aliases and make sure the Python (default) aliases are turned on.

Why is python not recognized in Command Prompt?

Either no Python is installed or its folder is not on PATH. Run py list first. If py works, use it, or add %LocalAppData%\Python\bin to your user Path so the python aliases work in every new terminal window.

How do I see all Python versions installed on Windows?

Type py list in Command Prompt to list every runtime the install manager can see, or py –list on a PC with the old launcher. where python shows each python.exe on PATH, which also catches copies the manager does not track.

Can I check the Python version in PowerShell?

Yes. python –version, py list and the other commands in this guide work the same in Windows PowerShell, PowerShell 7 and Windows Terminal. The shell does not change which Python answers; PATH and the app execution aliases do.

What is the difference between python -V and python -VV?

python -V prints only the version number, the same as python –version. python -VV, the switch given twice, adds build information such as the build date and the compiler, which helps when two copies report the same version number.

Is the Python launcher for Windows deprecated?

Yes. The standalone Python launcher has been deprecated since Python 3.14 and is replaced by the Python install manager, which still provides the py command. The full installer is deprecated too and will not be produced for Python 3.16 or later.

Which Windows versions does Python 3.15 support?

Python 3.15 supports Windows 10 and newer. Python only supports a Windows release while Microsoft gives it extended support, so Windows 8.1 users need Python 3.12 and Windows 7 users need Python 3.8.

The same commands also run in PowerShell; if you work there, you can check the PowerShell version in a similar way.

Should you use py or python to check the version?

Run python –version for a one-line answer, and switch to py list whenever more than one Python is installed. python –version reports only the copy PATH and the aliases point to, while py list shows every runtime and the default one, which is what settles pip and multi-version confusion.

Philip Celasco

Philip is a Texas-based technology writer and IT administrator at Techdows.com with more than 10 years of experience creating practical content for everyday users and professionals. He specializes in web browsers, particularly Chromium-based platforms such as Google Chrome, Microsoft Edge, Brave, and Opera. Through his work as an IT administrator, Philip has hands-on experience managing devices, configuring browser policies, troubleshooting software and network issues, and helping people resolve problems that affect productivity and security. His articles are based on practical testing and real-world technical experience. He covers browser settings, extensions, performance problems, privacy controls, security features, and Windows troubleshooting. Outside work, Philip enjoys the quieter side of life in Texas and stepping away from the screen when he can. He has two kids, two cats and loves to play golf with his mother during the weekends.

Leave a Reply

Your email address will not be published. Required fields are marked *