0

I suddenly have a problem with Python, which I first didn't have.

When I run python3 quickexample.py or python quickexample.py, I get the 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, when I run where python I get

C:\Users\Esmee\AppData\Local\Microsoft\WindowsApps\python.exe C:\Users\Esmee\AppData\Local\Programs\Python\Python36-32\python.exe C:\Python27\python.exe

And I have checked that C:\Users\Esmee\AppData\Local\Programs\Python\Python36-32 is in the environment variables, under system variables.

Also, running the exact same commands on Ubuntu instead of the cmd does not give any problems...

How do I fix this?

Thanks in advance!

Esmee
  • 93
  • 11
  • 1
    The error message seems to indicate that an "app ececution alias" is shadowing the real Python. Probably that's the first one printed by `where`. Like it says, try disabling it. – tripleee Mar 07 '21 at 11:36
  • Whether or not Python is installed in WSL is a completely separate topic, and irrelevant for your question. – tripleee Mar 07 '21 at 11:37
  • Thanks @tripleee! Disabling this made my Python work again :D However, now I need the command 'python' and the command 'python3' does not work anymore. Do you have any idea why this might be? – Esmee Mar 07 '21 at 19:56
  • 1
    Nope; I stay away from Windows and recommend others do the same. I thought you were supposed to use `py` on Windows anyway. If you want `python3` to work, an obvious solution is to create a cmd wrapper script with that name which simply runs Python and passes on all its arguments. – tripleee Mar 08 '21 at 04:52

0 Answers0