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.
- Select Start, type
cmdand open Command Prompt. - Type
python --versionand press Enter. - Read the output line, which starts with Python followed by the major, minor and patch numbers.
- If the line is missing or Windows says the command is not recognized, type
py listand 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.
- Open Command Prompt.
- Type
py listand press Enter to see every installed Python runtime. - Type
py list --oneand press Enter to see only the runtime thatpylaunches by default. - On a PC that still has the old Python launcher, type
py --listorpy -0pinstead; both legacy forms are still accepted by the install manager. - Type
pyon 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.

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.
- Open Command Prompt.
- Type
python(orpy) and press Enter. - Read the first line of the banner, which begins with Python and the version number.
- 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.
- Open Command Prompt.
- Type
python -c "import sys; print(sys.version_info)"and press Enter to see the major, minor, micro, release level and serial values. - Type
python -c "import platform; print(platform.python_version())"and press Enter to get a plainmajor.minor.patchlevelstring. - 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.
- Type
where pythonand press Enter to list every python.exe that Windows finds in the current folder and the folders on PATH, in search order. - Treat the first line as the copy that
pythonruns; a path under\Microsoft\WindowsApps\is an app execution alias, not the interpreter itself. - Type
py list --format=exeand press Enter to print the executable path of each runtime the install manager knows about. - Type
python -VVand press Enter to see the build string for the copy that answers. - Look for a
tafter the version inpy list, such as3.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.
- Type
py listand press Enter to see the tags you can use, such as3.14or3.13. - Run a script with one version:
py -V:3.13 myscript.py. For official releases theV:can be dropped, sopy -3.13 myscript.pydoes the same. - Pick an architecture with the full tag, for example
py -V:3-arm64. - Install packages for that version only:
py -3.13 -m pip install SomePackage. - Add a shebang line such as
#! python3at the top of a script sopy myscript.pypicks 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.

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.
- Select Start and open Installed apps.
- Search for
Python launcher. - Select it and choose Uninstall.
- Open a new Command Prompt and run
py listagain.
`pythonw` or `pyw` start a different version than `python` or `py`
The windowed aliases point somewhere else.
- Select Start, type
Manage app execution aliasesand open it. - Make the pythonw.exe and pyw.exe aliases match the python.exe and py.exe ones.
- Open a new terminal and test again.
Old py.ini settings no longer work
The Python install manager ignores py.ini.
- Move the default version into the
PYTHON_MANAGER_DEFAULTenvironment variable or a configuration file. - Run
py listto confirm the default changed.
Typing a script name opens it in a new window
This is a known Windows limitation with the install manager.
- Run the script as
py script-name.pyinstead. - 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.
- Run
py list. If it lists a runtime, usepyor add%LocalAppData%\Python\binto PATH for thepythonaliases. - Select Start, search for Edit environment variables for your account and add the folder to your user Path.
- Close every terminal, open a new one and run
python --versionagain.
`python` opens the Microsoft Store or prints nothing
An app execution alias is answering instead of an installed interpreter.
- Install the Python install manager if it is not installed yet.
- Select Start and open Manage app execution aliases.
- Check that the Python (default) aliases are turned on; if they already are, turn them off and on again.
- Make sure your PATH still contains
%UserProfile%\AppData\Local\Microsoft\WindowsApps. - 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.
- Run
where pythonto see which python.exe comes first. - Open Installed apps, find the older Python runtime and either remove it or choose Modify and clear its PATH options.
- Open Manage app execution aliases and set the python.exe alias to Python (default).
- Run
python --versionandpy list --oneand compare the results.
Neither command runs the version you expect
A default tag, a prerelease or an unmanaged install is being chosen first.
- Check the
PYTHON_MANAGER_DEFAULTenvironment variable. - Install the version you want with
py install 3.14so the manager owns it; managed installs win over unmanaged ones. - Uninstall a prerelease that is not managed by the install manager and reinstall it with
py install.

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.
- Run pip through the interpreter you checked:
python -m pip install SomePackage. - For one specific version, use
py -3.14 -m pip install SomePackage. - Inside a project, activate its environment with
.venv\Scripts\activatebefore installing.
"pip" or a package command is not recognized
The install manager does not create global shortcuts for new packages automatically.
- Use
python -m pipinstead ofpip. - Run
py install --refreshto rebuild the global shortcuts. - 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.
- Run
py listto see whether any runtime is installed at all. - If nothing is listed, install the Python install manager from the Microsoft Store or python.org.
- Open Manage app execution aliases and turn the Python (default) and Python install manager aliases off and on again.
- Uninstall Python launcher from Installed apps if
pyreports "can't open file". - Run
py install --refreshto recreate Start menu shortcuts, registry keys and global aliases. - Close all terminals, open a new Command Prompt and run
python --versionagain. - If it still fails, look for log files in your
%TEMP%folder and include them in a report on the Python bug tracker.

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 |

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.





