vscode调试python代码配置

2024-01-29 22:40:53
/
0 点赞
/
139 阅读
2024-01-29

配置

.vscode/launch.json

{
    // 使用 IntelliSense 了解相关属性。 
    // 悬停以查看现有属性的描述。
    // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
    // pythonPath 指定python代码运行路径
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Paddle代码调试",
            "type": "python",
            "request": "launch",
            "program": "${file}", // "${workspaceFolder}/tools/test.py"
            "console": "integratedTerminal",
            "justMyCode": false,
            "args": [
                "--task_name",
                "CoLA",
                "--do_train",
                "true",
            ]
        }
    ],
    "pythonPath": "/root/miniconda3/envs/sd/bin/python",
}

设置

需要注意的是,要把设置改为允许任何地点打断点debug.allowBreakpointsEverywhere=truecsharp.debug.justMyCode=false才能调试其他库

.vscode/settings.json

{
    "debug.allowBreakpointsEverywhere": true,
    "csharp.debug.justMyCode": false,
    "jupyter.debugJustMyCode": false
}

参考

版权属于:

那棵树看起来生气了

本文链接:

(转载时请注明本文出处及文章链接)