The error, verbatim
Jump to the fix ↓Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Apps > Advanced app settings > App execution aliases.
'pip' is not recognized as an internal or external command,
operable program or batch file.
Tested on
- OS
- Windows Server (GitHub windows-latest), Windows 11 Pro
- Python
- 3.12.10 (runner), 3.14.5 (install manager)
- pip
- 26.1.1
Contents
That message doesn’t come from Python. Windows ships a small placeholder python.exe (and python3.exe) in %LOCALAPPDATA%\Microsoft\WindowsApps, an “app execution alias” whose only job is to send you to the Microsoft Store. When it’s the first python.exe Windows finds, you get:
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Apps > Advanced app settings > App execution aliases.
The exit code is 9009, which is what a script or CI job sees.
I reproduced it on GitHub’s Windows runner, which has both the placeholder and a real Python 3.12.10. Running the placeholder directly, or with only WindowsApps on PATH, printed the message above. So “Python was not found” can appear on a machine where Python is installed: it depends on which python.exe comes first.
Step 1: see which python.exe wins
where.exe pythonThe first line is the one Windows runs. On the runner it listed the real Python first and the placeholder second:
C:\hostedtoolcache\windows\Python\3.12.10\x64\python.exe
C:\Users\runneradmin\AppData\Local\Microsoft\WindowsApps\python.exeIf the first line ends in WindowsApps\python.exe, that’s your problem, or Python isn’t installed at all.
Step 2: make the real Python come first
If Python is installed, move its folder above %LOCALAPPDATA%\Microsoft\WindowsApps in your PATH (Start → “Edit environment variables for your account” → Path → Move Up), then open a new terminal.
If Python isn’t installed, install it from python.org. The current installer is the Python install manager, and it takes over that same alias.
The message’s other suggestion, turning the alias off in Settings → Apps → Advanced app settings → App execution aliases, stops the placeholder from answering. It doesn’t install Python, so you still need step 2. I didn’t change that setting for this test.
Python works, but ‘pip’ is not recognized
python works, pip doesn’t. That’s how a fresh Python looks on Windows 11 when it’s installed through Python’s install manager (py install): on this PC, python and py ran, but in Command Prompt:
'pip' is not recognized as an internal or external command,
operable program or batch file.
pip3 gave the same message. pip is installed; Windows just can’t find a pip command, because the folder with it isn’t on your PATH. The install manager says so when it installs Python, in a line that’s easy to miss:
Global shortcuts directory is not on PATH. Add it for easy access to global Python aliases.
Fix 1: run pip through Python
You don’t need a pip command at all. Ask Python to run its pip:
py -m pip --version
py -m pip install requestsThis also guarantees you’re installing into the Python you’ll run. With several Pythons installed, py -V:3.14 -m pip … picks one explicitly.
Fix 2: put the shortcuts folder on PATH
If you want plain pip to work, add the folder from that message to your PATH:
Open Edit environment variables for your account (Start menu search), select Path, click New, add:
%LOCALAPPDATA%\Python\binThen open a new terminal.
How this was tested
GitHub Actions’ windows-latest runner, October 18, 2026: the WindowsApps placeholders run directly, then python --version with only WindowsApps and the system folders on PATH, and with the runner’s Python 3.12.10 before and after WindowsApps. The install manager case was a Windows 11 Pro PC with Python 3.14.5. The script and workflow are public. The pip case was the same Windows 11 PC: each way of starting pip was run in Command Prompt as installed, then again after the PATH change. Every message above is the real output.
— N.K., end of entry No.075