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

筅森魡賤 提交于 2020-12-30 06:12:10

问题


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 wich 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:


回答1:


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).




回答2:


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




回答3:


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




回答4:


I think you need to install Python first before using VSCode. You can download it from here: https://www.python.org/downloads/

Once it is installed, VSCode should detect it and run without problems.




回答5:


Sometimes this happens if you are using a virtual environment and you have not activated it on your command prompt.




回答6:


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




回答7:


I think you need to install python from microsoft window store. And also install python from python.org




回答8:


Type Python3 in console window. It will take you to Microsoft Store for installing Python.



来源:https://stackoverflow.com/questions/60842487/python-was-not-found-but-can-be-installed-from-the-microsoft-store-march-2020

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!