在 VS Code 中运行 Python 调试器不会在断点处停止

问题描述 投票:0回答:1

我有一个 python venv,我在 VS Code 中运行以下代码:

text = "hello"
print(text)

我试图在text =“hello”处中断, 我的 launch.json 文件是:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Debug Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "stopOnEntry": true,
            "justMyCode": false
        },
    ]
}

VS Code 终端命令是:

c:\Programming\Python\VEnv_Python310\Scripts\python.exe' 'c:\Users\lautry\.vscode\extensions\ms-python.python-2024.2.1\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher' '60718' '--' 'C:\Programming\Python\VEnv_Python310\test.py'

调试器没有在我的断点处停止。

python visual-studio-code debugging virtualenv
1个回答
0
投票

首先,在

print(text)

中标记断点

然后点击dndn面板中的三角按钮开始调试。

© www.soinside.com 2019 - 2024. All rights reserved.