How to Check Python Version in Windows CMD

If you’ve just installed Python or are working on a project that requires a specific version, it’s important to know which version of Python is currently active on your system. The easiest way to check that is through the Command Prompt (CMD) in Windows 11 or Windows 10.

In this guide, we’ll show you step-by-step how to check your installed Python version, verify environment variables, and fix common issues when Python isn’t recognized in CMD.

Why Check Your Python Version?

Knowing your Python version helps you:

  • Ensure compatibility with libraries and frameworks (like TensorFlow, Django, or Flask).
  • Debug “Python not recognized” errors.
  • Manage multiple Python versions (especially if you use Python 2 and Python 3).

1. Check Python Version Using Command Prompt

This is the most straightforward method to verify your Python installation.

  1. Press Windows + R to open the Run dialog box.
  2. Type cmd and hit Enter to open Command Prompt.
  3. Type one of the following commands and press Enter: python --version or python -V
  4. You’ll see an output like this: Python 3.12.2 This confirms Python is installed and working correctly.

2. Check Python Version Using the Python Command

If the above command doesn’t work, try launching the Python interactive shell.

  1. Open CMD again.
  2. Type: python
  3. Press Enter — this will open the Python REPL (interactive shell).
  4. Once inside, type: import sys print(sys.version)
  5. You’ll see a detailed version output like: 3.12.2 (tags/v3.12.2:1a1b2c3, Feb 6 2025, 09:32:00) [MSC v.1938 64 bit (AMD64)]

To exit the shell, type:

exit()

3. Check Python Version via Windows PowerShell

You can also check the version from PowerShell, which works similarly to CMD.

  1. Press Windows + X and select Windows PowerShell or Terminal.
  2. Type: python --version
  3. PowerShell will display the installed Python version if everything is configured correctly.

4. Check Installed Python Versions (When You Have Multiple Versions)

If you’ve installed multiple Python versions, you can list them all using:

py -0

This command shows all Python installations managed by the Python Launcher for Windows. Example output:

Installed Pythons found by py Launcher for Windows
 -3.12-64 *
 -3.11-64
 -3.10-32

The asterisk (*) indicates the default version.

5. Fix “Python is not recognized as an internal or external command”

If CMD returns this message:

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

It means Python isn’t added to your PATH environment variable.

How to Fix Python Path Error on Windows 11

  1. Press Windows + S and search for Edit the system environment variables.
  2. In the System Properties window, click Environment Variables.
  3. Under System Variables, select Path → click Edit.
  4. Click New and add your Python installation path, for example: C:\Users\<YourName>\AppData\Local\Programs\Python\Python312\
  5. Also add the Scripts folder: C:\Users\<YourName>\AppData\Local\Programs\Python\Python312\Scripts\
  6. Click OK, restart CMD, and run: python --version It should now show the correct version.

Wrapping Up

That’s it! You now know how to check your Python version using Command Prompt, PowerShell, and Python itself. If the command doesn’t work, ensure your PATH variable is configured correctly or reinstall Python with the “Add Python to PATH” option checked.

Posted by Arpita

With a background in Computer Science, she is passionate about sharing practical programming tips and tech know-how. From writing clean code to solving everyday tech problems, she breaks down complex topics into approachable guides that help others learn and grow.