Skip to content
Nilay Kabariya

Entry No.075·Fixes·Updated ·3 min read

Python was not found, or pip not recognized (Windows fix)

"Python was not found" comes from a Microsoft Store placeholder python.exe, not Python, and exits with 9009. How to see which python.exe wins, and the pip fix.

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.
✓ Reproduced on Windows Server (GitHub windows-latest), Windows 11 Pro

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
  1. Step 1: see which python.exe wins01
  2. Step 2: make the real Python come first02
  3. Python works, but ‘pip’ is not recognized03
  4. How this was tested04

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 python

The 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.exe

If 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 requests

This 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\bin

Then 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

Useful? Pass it on:Post on XFollow @EmotionalMatter

Related entries

  1. No.064

    Fix: Microsoft Visual C++ 14.0 or greater is required

    pip install fails on Windows asking for Microsoft C++ Build Tools. Four causes reproduced, Failed building wheel for pyyaml fixed, and when Build Tools help.

    > error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

    FIXED7 minWindows
  2. No.094

    Python CERTIFICATE_VERIFY_FAILED, tested on 3.12 to 3.15

    certificate verify failed: unable to get local issuer certificate, or Basic Constraints of CA cert not marked critical on Python 3.13+. Each cause tested.

    > requests.exceptions.SSLError: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/

    FIXED3 minWindows
  3. No.065

    No matching distribution found for torch: 5 causes, tested

    pip says Could not find a version that satisfies the requirement torch (from versions: none). Five causes reproduced on Windows, and the fix for each.

    > ERROR: Could not find a version that satisfies the requirement torch (from versions: none)

    FIXED4 minWindows

Post card · Every Sunday

What broke this week.

One email on Sundays: the Node, TypeScript, Python and AI SDK releases that broke builds that week, each one reproduced, with a link to the fix that worked. Never shared, and you can leave any time.

— Nilay

or follow by RSSor on X

By subscribing you agree to the privacy note. One click to leave.

tip: paste the exact error text