App execution aliases are tiny placeholder programs that Windows puts on your PATH so that typing python can open the Microsoft Store or launch an installed Python. To fix a broken python command, click Start, open Manage app execution aliases, and either enable the Python (default) entries or switch the Store entries off, depending on which Python you want to run.
This article follows the Python documentation page "Using Python on Windows" and the Microsoft Learn Python FAQ. Both are linked in the sources below. Where I show command output, it is example output, not a capture from your machine.
What an app execution alias is
An app execution alias is a shortcut executable that Windows keeps in %UserProfile%\AppData\Local\Microsoft\WindowsApps. The Python documentation says the operating system includes this folder in PATH once by default, after other user paths, and that "if removed, shortcuts will not be found."
Microsoft Learn explains why a python shortcut exists at all. It was added to help new users find a good Python installation: it takes you to the latest community package in the Microsoft Store. That package can be installed without administrator permissions and "will replace the default python and python3 commands with the real ones."
One detail matters for scripts. Microsoft Learn states that running the shortcut with any command-line arguments returns an error code to show that Python was not installed. That prevents a batch file from popping up the Store. Typing a bare python in a terminal is what opens it.
Which Python aliases exist
The Python install manager registers several commands. According to the Python documentation, after installation the python, py and pymanager commands should be available. Each also has a windowed version that avoids creating a console window: pyw, pythonw and pywmanager. A python3 command is included too. The documentation says it mimics python, is meant to catch accidental use of the POSIX command name on Windows, and is not meant to be widely used or recommended.
| Command | What it is |
|---|---|
python | Launches the default runtime |
py | The launcher from the install manager (an older launcher may already own this name) |
pymanager | The unambiguous name for the install manager |
pythonw, pyw, pywmanager | Windowed versions that avoid a console window |
python3 | Mimics python, not recommended for regular use |
How to open Manage app execution aliases
- Click Start.
- Type Manage app execution aliases and open the result.
- Scroll to the Python entries. You will see names such as Python (default), Python (default windowed) and Python install manager, each with an on/off switch. The exact list on your PC depends on what you have installed, so read the labels instead of relying on the order.
Fix: python opens the Microsoft Store
The Python documentation lists this symptom directly: "python gives me a 'command not found' error or opens the Store app when I type it in my terminal." Its first question back is whether you installed the Python install manager. If you have not, install it (see how to install Python on Windows) and type python again. The manager then installs the latest stable runtime if none is present.
If you have installed it and the Store still opens, the documented fix is:
- Open Manage app execution aliases.
- Check that the aliases for Python (default) are enabled.
- If they already are, disable and re-enable them to refresh the command.
- Do the same for Python (default windowed) and Python install manager if needed.
Open a new terminal afterwards. An already-open window can keep the state it had when it started.
Fix: turn the Store Python aliases off
You may not want the Store shortcut at all, for example because you installed Python from python.org and want that one to answer. Microsoft Learn describes this: open "Manage app execution aliases" from Start, find the "App Installer" Python entries, and switch them to Off. You can do this without installing Python first.
There is a second, PATH-based route. Microsoft Learn says that if you install Python with the python.org installers and select the "add to PATH" option, the new python command takes priority over the shortcut. It adds that other installers may add python at a lower priority than the built-in shortcut. In that case the shortcut wins, and switching it off is the simple fix.
Switching an alias off does not uninstall anything. You can switch it back on later.
Check which python Windows will run
Ask Windows where the name resolves. In Command Prompt or PowerShell:
where.exe python
Example output on a PC that has the install manager and a Store shortcut (the user name is a placeholder):
C:\Users\alex\AppData\Local\Microsoft\WindowsApps\python.exe
where.exe prints every match in PATH order, and the first one is the one that runs. A path inside WindowsApps means an alias is answering. PowerShell users can also run Get-Command python, which reports the first match. If nothing is printed, no python is on PATH at all.
Then confirm that the interpreter itself works and see its version:
python --version
To list the runtimes the install manager knows about, use py list. The documentation says this shows the installed runtimes.
Where the real commands live
The Python documentation notes that when the MSIX is installed but commands are not available in PATH, they can be found under %LocalAppData%\Microsoft\WindowsApps\PythonSoftwareFoundation.PythonManager_3847v3x7pw1km if installed from python.org, or ...PythonManager_qbz5n2kfra8p0 if installed through the Windows Store. It does not recommend running the executable directly from Program Files.
The install manager can also add its own directory to PATH the first time you install a runtime. This is optional if you prefer py, and it exposes the full range of aliases such as python3.15.exe. If those global aliases go missing or point at the wrong place, the documentation says py install --refresh updates all registrations for installed runtimes, which recreates Start menu shortcuts, registry keys and global aliases.
py install --refresh
If the python command still misbehaves
- Wrong version runs. The documentation says to check that your
python.exealias is set to Python (default). Also check the windowed commands,pythonw.exeandpyw.exe, so that they are consistent with your others. pysays command not found. This has the same first answer as above: install the Python install manager, then check the aliases.- Shortcuts vanish entirely. Look at your
PATHfor%UserProfile%\AppData\Local\Microsoft\WindowsApps. If someone removed it, shortcuts are not found until you add it back. - Old installs conflict. The Python documentation says to remove or undo older installs or hand-made
PATHedits that conflict with the manager.
Once python resolves correctly, keep each project's packages apart with a virtual environment. See how to create a Python virtual environment.
Is it safe to leave the aliases on?
Yes. They are small stubs, they do nothing until called, and the arguments rule means scripts fail with an error code instead of opening a window. The only cost is confusion when the name python points at a stub and not at a real interpreter. That confusion is what the checks above remove. If you want the exact behaviour for your PC, the order shown by where.exe python is the final authority.
Frequently asked questions
- Should I turn app execution aliases off for Python?
- Turn off the Python entries only if you installed Python some other way, for example with the python.org installer and its 'add to PATH' option, and the alias keeps getting in the way. If you use the Python install manager, leave 'Python (default)' on, because the Python documentation tells you to check that it is enabled.
- Where is the Manage app execution aliases setting?
- Click Start and type 'Manage app execution aliases', then open the result. Both the Python documentation and Microsoft Learn use this exact name. The page lists every alias with an on/off switch.
- Why does running python with arguments print an error instead of opening the Store?
- Microsoft Learn says that running the shortcut executable with any command-line arguments returns an error code to indicate that Python was not installed. This stops batch files and scripts from opening the Store by accident.
- Do app execution aliases affect pip?
- Only indirectly. If python resolves to the Store shortcut, python -m pip cannot work because no interpreter runs. Fix the python alias first, then use python -m pip so that pip belongs to the interpreter you expect.