vs code python_VSCode:无法识别术语“ python”……但是py可...

我刚刚在VS Code上安装了python,但无法使用python命令运行任何python代码.

python命令:

似乎默认情况下使用python命令,但无法识别它.

当我右键单击并选择“运行代码”时,它会抱怨:

无法将“ python”识别为内部或外部命令,可操作程序或批处理文件

手动运行python main.py也是如此.

当我打开提升的PowerShell并运行python时,它抱怨:

python : The term 'python' 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:1

+ python

+ ~~~~~~

+ CategoryInfo : ObjectNotFound: (python:String) [], CommandNotFoundException

+ FullyQualifiedErrorId : CommandNotFoundException

py命令:

它不会尝试使用py命令,但可以识别它.当我手动调用py main.py时,它可以工作.

当我手动执行> py main.py时,它会写下我的再见,World!

题:

如何仅使用CodeRunner的右键单击功能(运行代码)使其在VS Code中编译/运行?

我已经在PATH中同时拥有Python文件夹及其Scripts文件夹.

我正在使用VS Code 1.27.2,并且已经在计算机上安装了python 3.7.0,并检查了其安装程序复选框以自动添加环境变量. (路径正常)

我还安装了VS Code上的ms-python.python和tht13.python和Formulahendry.code-runner扩展.

这是我的main.py代码:

print("Goodbye, World!")