check python version windows is the CLI task of querying the installed Python interpreter version using commands like python --version or python -V on Windows CMD or PowerShell.
python --version
python -V
python3 --version
py --list
powershell -Command "python --version"
Options and Flags
| Flag | Type | Description |
|---|---|---|
--version |
Flag | Prints the Python version string and exits. |
-V |
Flag | Shorthand for --version. Identical output. |
-VV |
Flag | Verbose version: includes build number, compiler, and platform info. |
py --list |
Launcher | Lists all installed Python versions managed by the Python launcher for Windows. |
py -0 |
Launcher | Lists available versions in a compact format (one per line). |
Usage Examples
1. Rapid version check in CMD
C:Usersadmin> python --version
Python 3.12.2
This confirms the default interpreter version. The command returns exit code 0 on success.
2. Using the Python Launcher to see all installations
C:Usersadmin> py --list
-3.12-64 *
-3.10-32
The launcher (py.exe) scans the registry for all Python installations. The asterisk marks the default.
3. Check version inside a PowerShell script
$ver = & python --version 2>&1
Write-Output "Python version: $ver"
Capture both stdout and stderr. Using 2>&1 ensures the version string is captured even if output goes to stderr.
Troubleshooting & Common Errors
| Error Message | Root Cause | Resolution Command |
|---|---|---|
'python' is not recognized as an internal or external command |
Python not installed or not in PATH | Reinstall Python and check “Add Python to PATH”. Alternatively use py --version (launcher is in System32, always in PATH). |
Python was not found; run without arguments to install from the Microsoft Store |
Python executables missing; Windows 10+ store shortcut confuses CMD | Disable App Execution Alias for Python in Settings → Apps → App execution aliases, or install Python from python.org. |
python3: command not found (in PowerShell) |
Linux/Mac alias used on Windows | Use python instead of python3 on Windows. If multiple versions exist, use py -3.12 to specify. |
Access denied when running py launcher |
UAC restriction or corrupt launcher | Run CMD as Administrator or repair Python installation via “Modify” in Programs & Features. |
Multi-Platform Command Equivalents
| Platform | Command | Notes |
|---|---|---|
| Windows (CMD) | python --version |
Works if Python is in PATH. Also py --version uses launcher. |
| PowerShell | python --version |
Same command; optionally Get-Command python | Select-Object Version. |
| Linux (bash) | python3 --version |
Often python points to Python 2; use python3 explicitly. |
| macOS (Terminal) | python3 --version |
Apple removed Python 2; install via Homebrew for Python 3. |
No native cloud CLI subcommand; Python runtime selection is done via function configuration (AWS Lambda, Azure Functions) or container base images.
Frequently Asked Questions
What is the difference between python --version and python -V on Windows?
Answer: Both output the installed Python version; –version is the long flag, -V is the short equivalent.
Use --version for script readability and -V for quick manual checks. No functional difference exists. Example:
C:> python --version
Python 3.12.0
C:> python -V
Python 3.12.0
When should I use the py launcher instead of python on Windows?
Answer: Use py when multiple Python versions are installed.
The launcher reads the shebang line from scripts and respects py.ini. Common usage for version checks:
C:> py --list
-3.12-64 *
-3.11-64
C:> py -3.11 --version
Python 3.11.5
How do I fix “‘python’ is not recognized as an internal or external command” on Windows?
Answer: Add Python to the system PATH environment variable.
Manually update PATH via System Properties > Environment Variables. Typical paths: C:Python312 or %USERPROFILE%AppDataLocalProgramsPythonPython312. Verify after fixing:
C:> python --version
Python 3.12.0
Does python --version work on all Windows Server editions, including Windows Server Core and Nano Server?
Answer: Yes, on any Windows edition where Python is installed with console support.
Windows Server Core provides full PowerShell and legacy console. Nano Server lacks full Windows GUI but still runs command-line tools. Test with:
PS C:> python --version
Python 3.12.0
What is the fastest way to check Python version on Windows from PowerShell?
Answer: Run python –version or py –version directly.
Direct execution avoids overhead. Alternative: (Get-Command python).Version but slower. Fastest one-liner:
PS C:> (python --version) -replace 'Python '
3.12.0

Command Line Expert & Software Engineer
Welcome! I’m Thomas Heinrich, a software engineer and system administrator with a deep passion for the Command Line Interface (CLI). With years of experience navigating the terminal, building backend architectures, and automating server deployments, I created this space to share practical, real-world terminal knowledge.
Whether you are a beginner taking your first steps in a Linux environment or a seasoned DevOps engineer looking to optimize your deployment scripts, you will find actionable solutions here. My goal is to help you ditch the mouse, speed up your workflow, and harness the full power of the command line.