Skip to content
tricknfixGAMING · TECHNOLOGIE · INFORMATIQUE
Create

Translation of the initial post. Replies remain in their original language. Read the original

#logiciels-applications·Open questionTutorial

"python" opens the Microsoft Store or is not recognized on Windows: causes and solutions

Tutorial

You type python in a terminal and Windows opens the Microsoft Store, or the command is not found even though Python seems to be installed. Since Python 3.14, the recommended installation method on Windows is the Python install manager, which provides the python, py and pymanager commands. Most failures come from a Windows shortcut taking Python's place, a disabled alias or an old Python left on the PC.

Problem

  • python opens the Python page of the Microsoft Store.
  • python or py is not recognized in Command Prompt or PowerShell.
  • py displays a "can't open file" error.
  • python and py do not launch the same version.
  • pip is not recognized.

Observe before acting

Open a new terminal window and test the three commands:

PowerShell5 lines

python --version
py list
pymanager help
What you seeMost likely causeStep
python opens the Store, py unknownPython not installed, Windows shortcut activeStep 1
Python installed but no command respondsAliases disabled or PATH modifiedStep 2
py answers "can't open file"Legacy launcher takes priorityStep 3
python and py give two different versionsOld installation in the PATHStep 4
python works but not pipPackage shortcuts missing or virtual environment not activatedStep 5

Why "python" opens the Microsoft Store

Microsoft added a python shortcut to Windows which, as long as no Python is installed, leads to the Python page of the Microsoft Store. When launched with arguments (for example python script.py), this shortcut only returns an error code, to avoid opening the Store from a script. So this is neither a virus nor a fault: Python is simply not installed, or is not found before this shortcut.

Step 1: install the Python install manager

When to use it: python opens the Store and py is unknown.

Suggested solution

  1. Install the Python install manager from the Microsoft Store, or download it from python.org/downloads. The Python documentation states that both versions are identical.
  2. Close and reopen the terminal, then type python. If no version is installed yet, the latest stable release is installed automatically on first launch.
  3. If the installation offers to add a folder to the PATH (by default %LocalAppData%\Python\bin), this is optional: it is only used for version aliases such as python3.15.exe.

Expected result: python --version displays a version without opening the Store.

Rollback: the manager is uninstalled from Installed apps. Note: uninstalling it does not remove Python versions already installed.

Step 2: check the execution aliases and the PATH

When to use it: Python is installed with the manager, but python or py is still not found, or python still opens the Store.

Suggested solution

  1. Open the Start menu and search for Manage app execution aliases.
  2. Check that the Python (default) aliases are enabled. If they already are, turn them off and on again to refresh the command. Do the same if needed for Python (default windowed) and Python install manager.
  3. If Python aliases marked App Installer (the shortcut to the Store) remain active alongside, Python (default) is the one that must be selected for python.exe.
  4. Check that your account's PATH contains %UserProfile%\AppData\Local\Microsoft\WindowsApps (Start, search for Edit environment variables for your account, Path variable). Windows includes it by default; if the entry was removed, the shortcuts are no longer found.
  5. Open a new terminal and repeat the tests from the beginning.

Expected result: python, py and pymanager respond.

Rollback: the aliases are returned to their previous state in the same place; an entry added to the PATH is removed from the same window.

Step 3: "py" answers "can't open file"

When to use it: the py command exists but returns this error.

Suggested solution

This usually means the legacy py launcher (installed with the older python.org installers, now deprecated) takes priority over the install manager. Open Settings > Apps > Installed apps, search for Python launcher and uninstall it. Then reopen the terminal.

Expected result: py list displays the versions managed by the install manager.

Rollback: the legacy launcher can be reinstalled, but it will conflict with the manager again.

Step 4: "python" and "py" do not launch the same version

When to use it: python --version and py --version display different versions.

Suggested solution

  1. In Installed apps, find old Python installations. Uninstall those you no longer need, or use Modify to turn off their add-to-PATH option.
  2. In Manage app execution aliases, check that the python.exe alias points to Python (default).
  3. Type py list: the default version is shown there. It can also be forced by the PYTHON_MANAGER_DEFAULT variable; check that it is not set by mistake.

Expected result: both commands launch the same version.

Rollback: an uninstalled version can be reinstalled with py install followed by the desired version.

Do not uninstall a Python supplied by another program (development tool, scientific software) without checking that it does not depend on it.

Step 5: "pip" is not recognized

When to use it: python works but pip or an installed package's command cannot be found.

Suggested solution

  1. If you are working in a virtual environment, activate it first:
Batch3 lines

.venv\Scripts\activate
  1. Otherwise, use the form recommended by the Python documentation, which always works:
PowerShell3 lines

python -m pip --version
  1. To recreate the global shortcuts for installed packages:
PowerShell3 lines

py install --refresh

The output of this command tells you if the global shortcuts folder is missing from the PATH.

Expected result: python -m pip --version responds; after py install --refresh, package commands are available in a new terminal.

Rollback: none.

If activating the virtual environment in PowerShell is refused, see "Running scripts is disabled on this system" in PowerShell.

Final check

  • ☐ python --version displays a version without opening the Store.
  • ☐ py list shows the expected default version.
  • ☐ python -m pip --version responds.

If the failure persists, the manager writes its logs to the %TEMP% folder: they are useful for a bug report.

Sources

Still having the problem?

Reply to this topic with your Windows version (winver), how Python was installed (Store, python.org, other software), the output of python --version and py list, and the exact message you get. Remove your user name from paths before copying them.

Have an idea or a suggestion?

Be the first to join the discussion.

Reply

Reply without signing up using a TNF_… username saved on this device. You can post once every 30 minutes until you verify your email.

Add a GIF

Up to 5 GIFs per message.

Your draft stays on this device while you write.