Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages
Node.js, PHP and APIs

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 3

No Python is installed, so only the Store shortcut exists

Install the Python install manager, the way the CPython team now ships Python for Windows.

Fix
winget install 9NQ7512CXL7T -e --accept-package-agreements --disable-interactivity
py install --configure -y
py install default
Did this fix it?
Full steps for this cause: check, fix, verify

Short 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.

  • Applies to Windows 10 and 11, Python install manager (py, pymanager), Python 3.14 and 3.15
  • Updated
  • By Maaz Zindani, Senior Software Engineer

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.

Run this first
where.exe python

Then find the line you see in this list and open its fix:

  1. 1No Python is installed, so only the Store shortcut existswhere.exe python lists one path under ...\Microsoft\WindowsApps, and py is not recognised at all
  2. 2Python came from the old full installer without the PATH optionwhere.exe python shows the WindowsApps shortcut first, or alone, although a python.org install exists in your user folder
  3. 3The install manager is present but its aliases are off or stalepy 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.

Check
py --version

Fix

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.

Fix
winget install 9NQ7512CXL7T -e --accept-package-agreements --disable-interactivity
py install --configure -y
py install default

Verify

In a new terminal, python --version and py list both print a real Python version.

Verify
python --version

Confirmed by learn.microsoft.com

Did this fix it?

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.

Check
where.exe python

Fix

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.

Fix
# after switching the aliases off and modifying the install:
where.exe python
python --version

Verify

where.exe python lists the Python folder first and python --version prints the installed version.

Verify
python -c "import sys; print(sys.executable)"

Confirmed by github.com

Did this fix it?

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.

Check
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.

Fix
py list
py install --configure -y

Verify

A fresh terminal runs python and py, and both start the same runtime.

Verify
python -c "import sys; print(sys.version)"

Confirmed by docs.python.org

Did this fix it?

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.

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.