Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python was not found but can be installed from the Microsoft store (March, 2020)

I started watching a Python course on YouTube in which the guy giving the lesson teaches using VSCode. He started with software installation (Python & Pycharm). Then, in VSCode he downloaded the Python extension (the one made by Microsoft) and the extension called "Code Runner" to run the Python code on VSCode. When I try running my code it hits me with the following error which you can also see in the image on the link at the end of the question. I'm not able to post a screenshot of it because I'm new on this platform. Thanks to whoever sees this.

[Running] python -u "c:\Users\Ryan\Desktop\Python\app.py" Python was not found but can be installed from the Microsoft Store: htttps://go.microsoft.com/fwlink?linkID=2082640

Screenshot of the VSCode error screen:

enter image description here

like image 402
Luis M. Avatar asked Mar 25 '20 03:03

Luis M.


People also ask

How do I fix Python it was not found error?

To Solve Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases Error Then Go to start. type “Manage App Execution Aliases” Go to it and turn off “python”. Now, Your error must be solved.

Why does it say Python is not installed?

The “Python is not recognized as an internal or external command” error is encountered in the command prompt of Windows. The error is caused when Python's executable file is not found in an environment variable as a result of the Python command in the Windows command prompt.

Do I have to download Python from Microsoft Store?

For beginners who are new to Python, we recommend you install Python from the Microsoft Store. Installing via the Microsoft Store uses the basic Python3 interpreter, but handles set up of your PATH settings for the current user (avoiding the need for admin access), in addition to providing automatic updates.

How do I install Python on Windows Store?

To install the package, ensure you have the latest Windows 10 updates and search the Microsoft Store app for “Python 3.10”. Ensure that the app you select is published by the Python Software Foundation, and install it. Python will always be available for free on the Microsoft Store.


Video Answer


4 Answers

You don't have the command python installed into your PATH on Windows which is the default if you didn't get your copy of Python from the Windows Store. If you selected your Python interpreter in VS Code (look in the status bar), then I would disable Code Runner. That way the Python extension is what provides the ability to run Python (the Play button will be green instead of white).

like image 86
Brett Cannon Avatar answered Oct 21 '22 17:10

Brett Cannon


python install directory, bin, and lib-scripts must be to the top of WindowsApps directory, like the image below

enter image description here

like image 32
Erfan Eghterafi Avatar answered Oct 21 '22 17:10

Erfan Eghterafi


Prior to do "start -> then search -> Manage App Execution Aliases -> turn off" make sure that you have added PYTHONPATH with details (C:\Program Files\Python37;) in system-environment-variable. Then do the "turn-off" as mentioned above. This will work

like image 16
Aniyarath Avatar answered Oct 21 '22 18:10

Aniyarath


Go to start -> then search -> Manage App Execution Aliases -> turn off

like image 11
Raj Kalathiya Avatar answered Oct 21 '22 16:10

Raj Kalathiya