美好的早晨。从昨天开始,我似乎无法使用Debugpy连接到我的调试器。我遇到了一个回复错误,我没有真正改变任何东西,似乎无法连接到我的调试器。 deb ...

问题描述 投票:0回答:1
import os import debugpy os.environ['PYDEVD_DISABLE_FILE_VALIDATION'] = '1' if os.environ.get('DEBUG','false').lower().strip() == 'true': debugpy.listen(("localhost", 5678)) print("Waiting for debugger attach on port 5678...") debugpy.wait_for_client() print("Debugger attached!")

这是我的VSCODE启动。

{ "version": "0.2.0", "configurations": [ { "name": "Serverless Debug", "type": "python", "request": "attach", "port": 5678, "host": "localhost", "console": "integratedTerminal", "pathMappings": [ { "localRoot": "${workspaceFolder}", "remoteRoot": "." } ] // , // "pythonArgs": [ // "-Xfrozen_modules=off" // ] } ] }

也尝试了这一点:

{ "version": "0.2.0", "configurations": [ { "name": "Serverless Debug", "type": "debugpy", "request": "attach", "connect": { "host": "localhost", "port": 5678 }, "pathMappings": [ { "localRoot": "${workspaceFolder}", "remoteRoot": "." } ] } ] }

其他人经历过吗?

我似乎有同样的问题。我也没有进行任何更改或更新,并且在通过debugpy.listen()添加调试器时无法再附加。从VSCODE(不通过听力)启动调试器的工作原理。
在听()后,我还得到了“ Lost sys.stderr”,我以前从未遇到过。
help表示赞赏!

python visual-studio-code debugging debugpy
1个回答
0
投票
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.