Home > OS >  Python was not found error when runnig code
Python was not found error when runnig code

Time:08-22

After a few routine windows updates, I started getting this error when I was running python code in VSCode.

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

I got told to first check PATH and to untoggle Python in App Execution Aliasies. I figured that python was already added to the PATH (I had just checked the box when downloading) and that when I untoggle Python in App Execution Aliasies I get another error

'python3' is not recognized as an internal or external command, operable program or batch file.

So I'm essentially stuck between two different errors and a correct PATH and the only times when I can run a code is when I run it from the default Python IDE that comes in the download package.

Anyone know how to fix this?

PS. when I download Python from Windows Store, it works but I don't know how to use pip with it to install external packages.

Below is the pic of my PATH.

enter image description here

CodePudding user response:

Please reinstall python. When you install python, there will be a prompt in the lower left corner to automatically add it to the environment variable. Please check it.

At the same time, please select the correct Python interpreter in vscode.

You can refer to docs for more information.

CodePudding user response:

You could try redownloading python from www.python.org.

  • Related