1

As of yesterday I could run a python command like

python code.py

on a windows 10 powershell command line. After an update this does not work anymore and I get an error

Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.

However python is installed:

> where.exe python
C:\Users\DALEX\AppData\Local\Microsoft\WindowsApps\python.exe

and that path is in the environment variable PATH

enter image description here

How to fix this problem so I can use python again?

1 Answer 1

0

The message is coming from python.exe itself. Specifically, you're running the fake python.exe that Windows includes, which is supposed to either automatically redirect to either the real Python or to open the Microsoft Store page.

Visit the "Settings > Manage App Execution Aliases" screen it mentions, disable the python.exe alias pointing to this redirector, and enable the python.exe alias that belongs to your actually installed Python runtime (if you had it installed from Microsoft Store). Do the same with pythonw.exe.

If your Python runtime is not from the Store, you still should disable the alias, so that the real python.exe from elsewhere in your $env:PATH would be found.

5
  • I see three links(?) to Python 3.10: python.exe, python3.exe and python3.10.exe. Which is what??
    – Alex
    Commented Apr 14, 2023 at 6:22
  • It's three links to Python 3.10, that's all it is. Commented Apr 14, 2023 at 6:23
  • So what do I have to do? I do not understand your answer then ... What do I disable, what do I enable?
    – Alex
    Commented Apr 14, 2023 at 6:38
  • @Alex - Install Python on your system then disable the alias
    – Ramhound
    Commented Apr 14, 2023 at 12:55
  • python is already installed
    – Alex
    Commented Apr 14, 2023 at 13:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .