遇到了同样的问题。如果您仍然需要知道,这就是我解决它的方法。
- 在 vscode 中创建工作区
- 将您想要的文件夹与您需要的所有文件一起添加到工作区中。我们需要这样做来创建 launch.json 文件
- 单击调试图标或 Ctrl+Shift+D
- 单击顶部调试侧边栏中的齿轮图标。它会说 open 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": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
}
]
}
- 添加 justMyCode,但设置为 false
{
// 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": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": false
}
]
}
- 保存并开始调试。您现在应该可以进入其他模块了。
调试屏幕配置现在应该是什么样子的屏幕截图:
如果您不想调试其他模块或做其他事情,您可以创建不同的配置。