How to Check if Python Is Installed (Windows, Mac, and Linux)

To check if Python is installed, open a terminal (Command Prompt or PowerShell on Windows, Terminal on Mac or Linux) and run python --version or python3 --version. If you see a version number such as Python 3.13.1, Python is installed and on your PATH. On Windows, you can also try py --version. A quick command also tells you where Python lives and whether pip, Python’s package installer, is ready to use, and the sections below cover what to do when the check fails.

Check on Windows

  1. Press Windows + R, type cmd, and press Enter.
  2. Type python --version and press Enter.
  3. If that doesn’t work, try py --version. The py launcher is installed with the official Python installer from python.org and works even when Python isn’t on your PATH.

To see where Python is installed, run where python. If you see a path ending in WindowsApps\python.exe and typing python opens the Microsoft Store, that’s only a shortcut Windows provides. It means Python isn’t actually installed yet. You can turn these shortcuts off under Settings > Apps > Advanced app settings > App execution aliases.

You can also check for Python in Settings > Apps > Installed apps. Each version, such as Python 3.13, appears as its own entry.

Check on a Mac

  1. Open Terminal from Applications > Utilities, or search for it with Spotlight.
  2. Run python3 --version.

Current versions of macOS don’t include the old Python 2, so use python3. If macOS offers to install the Command Line Developer Tools, that installs a version of Python 3 along with other developer tools. Many developers install the latest Python from python.org or a package manager instead. Run which python3 to see which copy you’re using.

Check on Linux

Most Linux distributions include Python 3. Open a terminal and run python3 --version. Use which python3 to find its location. On some distributions, the python command isn’t set up by default, so stick with python3.

Confirm Python actually works

A version number shows Python is installed, but running code confirms it works properly. Start the interactive interpreter by typing python (or python3), then type:

print("Python is working")

Press Enter. If the message prints, everything is fine. Type exit() to leave. You can also run a one-line test without entering the interpreter: python -c "import sys; print(sys.version)".

Check that pip is installed

Pip installs Python packages. Run python -m pip --version (or python3 -m pip --version). If you see a version number and a path, pip is ready. If you get “No module named pip,” run python -m ensurepip --upgrade to install it.

If Python isn’t recognized

An error like ‘python’ is not recognized as an internal or external command means one of two things:

  • During setup on Windows, check Add python.exe to PATH.
  • Python is installed but not on your PATH. Windows can’t find it from the command line.

After changing PATH, close and reopen the terminal so it picks up the change.

Do I need administrator rights to check?

No. Checking the version works from a normal terminal window.

Multiple versions of Python

It’s common to have more than one Python installed. On Windows, run py --list to see every version the launcher knows about, and start a specific one with py -3.12. On Mac and Linux, versioned commands like python3.12 run a particular version. To find the exact folder for each, see how to find the Python path in Windows.

Why does python –version show Python 2?

An older Python 2 is first on your PATH. Use python3 or update PATH so Python 3 comes first. Python 2 is no longer supported.

Virtual environments

If a project uses a virtual environment, activate it before checking. Inside an active environment, the version and pip commands report that environment’s Python, which may be different from your system-wide installation. That’s normal and lets each project keep its own packages.

Check Python inside an editor

Code editors like VS Code use whichever interpreter you select, which may differ from the one in your terminal. In VS Code, press Ctrl + Shift + P, choose Python: Select Interpreter, and confirm the version listed.

Related: How to fix the Python list assignment index out of range error.

Related: Install pip on Windows.