3

Now I know that this question has been asked before at: Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings but I have tried doing everything that all the answers said to do but nothing works.

I am using Visual Studio Code to run a Python file, however when I try running the file using the 'Run Python File' play button in the top right corner, it gives me this error: Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.

I have made sure that python is installed, but just to be sure I uninstalled and reinstalled it again. I also made sure to check the box saying 'Add Python to PATH' before reinstallation. Furthermore I have also tried doing as the message prompts you to, and turned off the shortcut from Settings > Manage App Execution Aliases; but when I do that it gives me the following error:

& : The term 'C:/Users/haide/AppData/Local/Microsoft/WindowsApps/python.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:3

  • & C:/Users/haide/AppData/Local/Microsoft/WindowsApps/python.exe "g:/M ...
  • + CategoryInfo          : ObjectNotFound: (C:/Users/haide/...Apps/python.exe:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
    
    
    
    

I have also manually checked the PATH in System Properties > Environment Variables and it's fine there as well. I have also made sure that I am in powershell in the terminal rather than cmd. The file does run if I type py filename.py in the terminal, but why is the play button not working, even though it was working until yesterday?

Marium
  • 33
  • 1
  • 6
  • Are you sure that is the correct path to your python exe? – Ismail Hafeez Mar 13 '21 at 11:01
  • In the user variables, it is correct, but I can't see it in the system variables. Is that the problem? I don't really know where and what to write in the System variables though. – Marium Mar 14 '21 at 01:35
  • I was able to [setup Python in VSCode](https://www.youtube.com/watch?v=q8yyjhxSPdI) with on problem by following this tutorial. – InfiniteStack Jul 29 '22 at 03:06

1 Answers1

1

You may check in vscode:

  1. ctrl + maj + p
  2. on the prompt, type python then select an interpreter
  3. select the path you want

That's all, this pop up is for making the green play button work fine

a121
  • 798
  • 4
  • 9
  • 20
Pixailz
  • 26
  • 6