问题描述
我开始在 YouTube 上观看 Python 课程,在该课程中,授课人员使用 VSCode 进行教学.他从软件安装(Python 和 Pycharm)开始.然后,他在 VSCode 中下载了 Python 扩展(微软制作的)和名为Code Runner"的扩展.在 VSCode 上运行 Python 代码.当我尝试运行我的代码时,它给我带来了以下错误,您也可以在问题末尾的链接上的图像中看到.我无法发布它的屏幕截图,因为我是这个平台上的新手.感谢看到这个的人.
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.
[运行] python -u "c:\Users\Ryan\Desktop\Python\app.py";未找到 Python,但可以从 Microsoft Store 安装:http://go.microsoft.com/fwlink?linkID=2082640
[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
VSCode 错误屏幕截图:
Screenshot of the VSCode error screen:
推荐答案
您没有将命令 python
安装到 Windows 上的 PATH
中,如果您没有从 Windows 应用商店获得 Python 副本.如果您在 VS Code 中选择了 Python 解释器(查看状态栏),那么我将禁用 Code Runner.这样,Python 扩展就提供了运行 Python 的能力(播放按钮将是绿色而不是白色).
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).
这篇关于找不到 Python 但可以从 Microsoft Store 安装(2020 年 3 月)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!