简体   繁体   English

如何在vscode中更改python的执行者?

[英]How to change the executer of python in vscode?

I was trying to change the executer of python in vscode .我试图在vscode中更改python执行者 I have installed python3 in my system.However default executer of python in vscode is python.So i am getting error as 'python not found' whenever i try to run code.我已经在我的系统中安装了 python3。但是,vscode 中 python 的默认执行器是 python。所以每当我尝试运行代码时,我都会收到“找不到 python”的错误。 So how could i change the executer to python3 in line no 4066?那么我如何在第 4066 行将执行器更改为 python3 呢? 在此处输入图像描述

I tried to change from user settings.我试图改变用户设置。 I could change the interpreter there.我可以在那里更换口译员。 However i didnt find any way to change the executer.但是我没有找到任何方法来更改执行器。 在此处输入图像描述

That's default command Code Runner provides for Python Language.这是Code Runner为 Python 语言提供的默认命令。

As long as the execution scripts in terminal when you run python file instead of run code is python3.8, run code should also use python3.8.只要你运行python文件而不是运行代码时终端中的执行脚本是python3.8,运行代码也应该使用python3.8。

OR you can change the command directly:或者您可以直接更改命令:

"code-runner.executorMap": {
    "python": "path/to/python3.8/python.exe -u",
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM