vscode使用虚拟环境debug,无法在三方库中的断点上停止

一开始以为是虚拟环境设置的问题。

搜索vscode 使用虚拟环境调试,出来一大堆,下面这个是比较详细的。

https://www.yuque.com/rebooting/blog/whfzge

然鹅好像跟我的问题无关,我的问题是这样的:

launch.json

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [

        {
            "python":"D:\\workspace\\vs_test_venv\\Scripts\\python.exe",
            "name": "Python: 当前文件",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
        }
    ]
}

断点打在自己的代码上,是可以正常停住的。但是打在三方库的代码里面,停不住。

如图,断点是灰色的。而且,从外面点击step in也没有反应的。

鼠标指针移上去,问题清楚了:

弹出来一个框:

Breakpoint in file excluded by filters.

Note: may be excluded because of "justMyCode" option (default == true).Try setting "justMyCode": false in the debug configuration (e.g., launch.json)

原来是默认只调试自己的代码,修改launch.json就好了:

            "console": "integratedTerminal",
            "justMyCode": false,  // 根据说明在launch.json里面加上这一行即可
        }

 

 

  • 15
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 10
    评论
评论 10
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值