You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

VSCode中launch.json配置致调试失效,求修改方案

问题修复方案

你的launch.json存在两个关键问题导致调试器无法启动:

  1. JSON语法错误:"justMyCode": false, 末尾多余的逗号会触发JSON解析失败,这是最直接的原因。
  2. 配置项放错位置:debug.allowBreakpointsEverywhere 和 jupyter.debugJustMyCode 是VSCode的全局设置,不属于launch.json的配置范围,应该放在.vscode/settings.json中。

修改后的launch.json

{
    "configurations": [
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "env": {"PYDEVD_WARN_SLOW_RESOLVE_TIMEOUT": "5"},
            "justMyCode": false
        }
    ]
}

对应的settings.json(如果没有则新建)

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

修改完成后重启VSCode的调试会话即可正常启动调试器。

内容的提问来源于stack exchange,提问作者shamalaia

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.29 14:52:05