This issue is confusing because Windows behaves as though Python is available, yet the command does not launch an interpreter. Instead, it redirects you to Microsoft Store. That redirect is not Python itself. It is a Windows alias designed to help users install Python when no usable python.exe is found.
The correct fix depends on what is already installed. If Python is installed, disable the redirect and point Windows to the real executable. If Python is not installed, install it properly rather than repeatedly opening the Store page.
First, confirm what Windows is resolving
Open Command Prompt and run:
where python
where py
python --version
py --version
If where python shows a path inside WindowsApps, the Store alias is taking priority. If py --version works, Python may already be installed and the Python Launcher can see it even though the python command cannot.
Fix 1 — Disable the Microsoft Store Python aliases
- Open Settings.
- Go to Apps → Advanced app settings → App execution aliases.
- Find python.exe and python3.exe.
- Turn both aliases off.
- Close every open terminal and open a new Command Prompt.
- Run
python --versionagain.
Turning off the aliases stops Windows from hijacking the command. It does not add Python to PATH, so the command may change from opening Store to showing “not recognized.” That is progress because Windows is now exposing the real configuration problem.
Fix 2 — Locate the actual Python installation
Common user-level installation locations include:
C:\Users\YOUR-NAME\AppData\Local\Programs\Python\Python312\
C:\Users\YOUR-NAME\AppData\Local\Programs\Python\Python311\
Look for python.exe. Also check the accompanying Scripts folder, which contains tools such as pip.
Test the executable directly:
"C:\Users\YOUR-NAME\AppData\Local\Programs\Python\Python312\python.exe" --version
If this works, Python itself is healthy. Only command discovery needs repair.
Fix 3 — Add Python and Scripts to PATH
- Search Windows for Edit environment variables for your account.
- Under User variables, select Path and choose Edit.
- Add the folder containing
python.exe. - Add its
Scriptssubfolder on a separate line. - Save the changes and reopen Command Prompt.
Example entries:
C:\Users\YOUR-NAME\AppData\Local\Programs\Python\Python312\
C:\Users\YOUR-NAME\AppData\Local\Programs\Python\Python312\Scripts\
python.exe itself. Add the folder containing it. Avoid deleting unrelated PATH entries while editing the list.
Fix 4 — Repair the Python installation
If the installation folder exists but Python does not start, open Installed apps, locate Python, choose Modify, and run Repair. If Repair is unavailable, rerun the official installer for the same version and enable the option to add Python to PATH.
Fix 5 — Reinstall cleanly when the installation is incomplete
Remove only the broken Python version, restart Windows, then install the required version from the official Python installer. During setup:
- Enable Add python.exe to PATH.
- Keep pip selected.
- Use a per-user installation unless you specifically need all-users access.
- After installation, open a completely new terminal.
Verify the final result
where python
python --version
python -m pip --version
The first command should point to a real Python installation, not the WindowsApps alias. The pip command should report the same Python installation path.
FAQ
Why does Windows include a Python Store alias?
It is a convenience shortcut for systems without Python. It becomes a problem when it takes priority over an existing installation.
Should I install Python from Microsoft Store?
The Store version can work, but the standard installer gives clearer control over PATH, versions, and development tools. Use one method consistently.
Why does py work while python opens Store?
The Python Launcher can locate installed versions independently, while the python command depends on PATH and aliases.