Windows answers python with a Microsoft Store shortcut instead of running Python
Your error
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.Fix it fast
Most common cause, 1 of 3No Python is installed, so only the Store shortcut exists
Install the Python install manager, the way the CPython team now ships Python for Windows.
winget install 9NQ7512CXL7T -e --accept-package-agreements --disable-interactivity
py install --configure -y
py install defaultShort answer
Python was not found; run without arguments to install from the Microsoft Store comes from a Windows shortcut, not Python. It runs when no real python.exe comes first on PATH: Python is missing, the full installer skipped PATH, or the install manager's aliases are off. Install the Python install manager, or switch off the App Installer aliases and fix PATH.
Which cause do you have?
Ask Windows which python.exe files it finds on PATH, in order. A single hit under AppData\Local\Microsoft\WindowsApps is the Store shortcut; a real install shows its own folder.
where.exe pythonThen find the line you see in this list and open its fix:
- 1No Python is installed, so only the Store shortcut exists
where.exe python lists one path under ...\Microsoft\WindowsApps, and py is not recognised at all - 2Python came from the old full installer without the PATH option
where.exe python shows the WindowsApps shortcut first, or alone, although a python.org install exists in your user folder - 3The install manager is present but its aliases are off or stale
py or pymanager responds, yet python still prints the Store message or says the command is not found
What does the error look like?
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
Cause 1 of 3
No Python is installed, so only the Store shortcut exists
You seewhere.exe python lists one path under ...\Microsoft\WindowsApps, and py is not recognised at all
Check
Microsoft's Python FAQ explains the Python was not found message: Windows ships a python.exe shortcut that opens the Store, and when it gets any command-line argument it returns an error instead, so scripts and editors do not pop up the Store.
py --versionFix
Install the Python install manager, the way the CPython team now ships Python for Windows. It is on python.org/downloads and in the Store; WinGet can install it from a terminal. Then install a runtime.
winget install 9NQ7512CXL7T -e --accept-package-agreements --disable-interactivity
py install --configure -y
py install defaultVerify
In a new terminal, python --version and py list both print a real Python version.
python --versionConfirmed by learn.microsoft.com
Cause 2 of 3
Python came from the old full installer without the PATH option
You seewhere.exe python shows the WindowsApps shortcut first, or alone, although a python.org install exists in your user folder
Check
The shortcut wins over an installed Python that was never added to PATH, and Microsoft notes other installers may add python at lower priority than the shortcut. In the CPython tracker, a CPython contributor's answer to the same message is to turn off the python.exe and python3.exe aliases and modify the install to add Python to the environment variables.
where.exe pythonFix
Open Start, Manage app execution aliases, and switch the App Installer python.exe and python3.exe entries off. Then run the installer again, choose Modify, and enable adding Python to the environment variables. The full installer is deprecated since 3.14, so moving to the install manager is the longer-term fix.
# after switching the aliases off and modifying the install:
where.exe python
python --versionVerify
where.exe python lists the Python folder first and python --version prints the installed version.
python -c "import sys; print(sys.executable)"Confirmed by github.com
Cause 3 of 3
The install manager is present but its aliases are off or stale
You seepy or pymanager responds, yet python still prints the Store message or says the command is not found
Check
Python's Windows guide lists a python that opens the Store as a known install-manager symptom. Its fix is to enable the Python (default) aliases under Manage app execution aliases, toggling them off and on to refresh, and to keep the WindowsApps folder on the user PATH.
echo %PATH%Fix
Enable or refresh the Python (default), Python (default windowed) and Python install manager aliases. If %UserProfile%\AppData\Local\Microsoft\WindowsApps was removed from the user PATH, add it back through Edit environment variables for your account.
py list
py install --configure -yVerify
A fresh terminal runs python and py, and both start the same runtime.
python -c "import sys; print(sys.version)"Confirmed by docs.python.org
How do I stop it coming back?
- Use one source of Python per machine: the install manager, or the deprecated full installer, not both.
- In scripts and editor settings, call py or a virtual environment's own python.exe instead of a bare python.
- Create a .venv per project with python -m venv .venv and point the editor's interpreter at .venv\Scripts\python.exe.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine on the same stack: stegnor.com, Menulo, ShopGo.