|

Python Is Not Recognized On Windows: How To Fix It (2026)

Quick answer

  • Install the Python install manager from the Microsoft Store or python.org/downloads, open a new terminal and type python; if Windows still says the command is not found or opens the Store, open Start, search for Manage app execution aliases and make sure the Python (default) alias is on.
  • Check that your PATH contains %UserProfile%\AppData\Local\Microsoft\WindowsApps, the folder where those aliases live.
  • If py works but python does not, or py says it cannot open a file, old Python installs or the legacy Python launcher are the usual cause, and the Python documentation says to remove them in Installed apps.

Applies to: Python install manager on Windows, as described in the Python 3.15 documentation

This guide is for anyone who types python in Command Prompt or PowerShell and gets a message that the command is not recognized, or sees the Microsoft Store open instead.

On Windows the cause is almost always that no Python is installed, that the Windows alias for it is switched off, or that an older Python install is getting in the way.

Every step below comes from the official Python documentation page “Using Python on Windows” (Python 3.15.2), which this guide read on November 29, 2026.

Table of Contents

Quick answer: match your symptom to the fix

What you seeMost likely causeFix
python says command not found or opens the StorePython install manager missing, or its alias is offInstall it, then turn on Python (default) in Manage app execution aliases
py says command not foundSame as aboveSame steps, then check the WindowsApps PATH entry
py says it cannot open a fileThe older Python launcher has priorityUninstall “Python launcher” in Installed apps
python starts a different Python than pyAn older install or PATH change is firstRemove it or turn off its PATH option, and set the alias to Python (default)

Step 1: install the Python install manager

The Python documentation describes the install manager as the tool that makes Python available as global commands on Windows.

You can get it from the Microsoft Store app or from python.org/downloads, and the documentation says the two versions are identical.

  1. Open the Microsoft Store listing for Python install manager, or the downloads page on python.org.
  2. On the Store, click Install.
  3. When it finishes, close any open terminal and open a new one.
  4. Type python and press Enter.

If you downloaded the file from python.org instead, double-click it and select Install, or run the command below in Windows PowerShell with the path to the MSIX file.

Add-AppxPackage <path to MSIX>

The documentation says that after installation the python, py and pymanager commands should be available.

It also says that if you already have Python installs or have changed PATH yourself, you may need to remove them or undo the changes.

What the python command does

The documentation calls python the recommended command for launching Python.

It starts the version your script asks for, the active virtual environment, or the default installed version, which is the latest stable release unless you configured another.

If no Python is installed yet, the documentation says the latest release is installed for you the first time you run it.

CommandWhat the documentation says it is for
pythonThe recommended command for launching Python
pyCan be used anywhere in place of python or the older py.exe launcher
pymanagerAn unambiguous command, useful when the older launcher has taken the py name
python3Catches accidental use of the POSIX name and is not meant to be widely used

Step 2: turn on the app execution alias

If you installed the manager and python still opens the Store or reports command not found, the alias is the next thing to check.

  1. Click Start and open Manage app execution aliases.
  2. Find Python (default) and make sure it is switched on.
  3. If it is already on, switch it off and on again to refresh the command.
  4. Check the Python (default windowed) and Python install manager entries, which may also need refreshing.
  5. Open a new terminal and try py and pymanager to see whether those commands work.

Step 3: check the WindowsApps folder is on PATH

The documentation says your PATH must contain %UserProfile%\AppData\Local\Microsoft\WindowsApps.

Windows includes that entry once by default, after your other user paths, and the documentation warns that if it was removed the shortcuts will not be found.

To look at or restore it, follow our guide to editing environment variables and PATH in Windows 11.

Step 4: remove the older Python launcher

The documentation lists a separate symptom, where py gives a “can’t open file” error.

Its explanation is that the older launcher is usually installed and has priority over the new one.

  1. Click Start and open Installed apps.
  2. Search for Python launcher.
  3. Uninstall it.

The documentation adds that when the older launcher is installed its py command overrides the install manager one, so you then use pymanager for installs and uninstalls.

When python and py start different versions

If python does not launch the same Python as py, the documentation points to leftovers from earlier installs.

  1. Click Start and open Installed apps.
  2. Look for existing Python runtimes and remove them, or choose Modify and turn off their PATH options.
  3. Click Start, open Manage app execution aliases, and check that the python.exe alias is set to Python (default).

If the wrong version starts rather than none, run the command below to see which one is the default.

py list

The documentation says the default can be set by the PYTHON_MANAGER_DEFAULT environment variable or a configuration file, so check those if the list shows a surprise.

If the message is about py

The documentation quotes this exact message for the older launcher: ‘py’ is not recognized as an internal or external command, operable program or batch file.

It states that this means the launcher is not installed, which is why installing the install manager is the first step above.

Do you need to add Python to PATH yourself

The documentation says that when you first install a runtime you will likely be prompted to add a directory to PATH, and that this is optional if you prefer the py command.

The offer exists for people who want the full range of aliases, such as python3.15.exe, to be available.

ItemValue on the Python page
Default directory it offers to add%LocalAppData%\Python\bin
Where to add itClick Start and search for Edit environment variables for your account
Who can change the directoryAn administrator may customize it
Scripts of each runtimeEach runtime has its own scripts directory, which must also be on PATH to use those tools

Check that it worked

Open a new terminal window, because an old one keeps the PATH it started with, and run the command below.

py help

This prints the help for the install manager, which confirms the py command is found.

Then type python, which should open the interpreter prompt instead of an error or the Store.

After python works

If you need an editor, see our guide to installing Visual Studio Code on Windows 11.

A related problem is a missing pip command, which the same Python page covers as its own symptom.

Source

Leave a Reply

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