MacOS: 10.15.6 Visual代码: 1.49.1
launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Remote Attach",
"type": "python",
"request": "attach",
"logToFile": true,
"justMyCode": false,
"outputCapture": "std",
"connect": {
"host": "localhost",
"port": 5678
},
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "${workspaceFolder}"
}
]
}
]
}码头命令码头运行-名称faber -rm -it
-p 0.0.0.0:8020-8027:8020-8027 -p 8028:8028
.
Visual代码日志文件
0 Starting Session:
{
"name": "Python: Remote Attach",
"type": "python",
"request": "attach",
"logToFile": true,
"justMyCode": false,
"outputCapture": "std",
"connect": {
"host": "localhost",
"port": 5678
},
"pathMappings": [
{
"localRoot": "/Users/j.bora/work/bsi/Blockchain/identity-and-access-management/aries-cloudagent-python",
"remoteRoot": "/Users/j.bora/work/bsi/Blockchain/identity-and-access-management/aries-cloudagent-python"
}
],
"debugOptions": [
"DebugStdLib",
"RedirectOutput",
"UnixClient",
"ShowReturnValue"
],
"showReturnValue": true,
"workspaceFolder": "/Users/j.bora/work/bsi/Blockchain/identity-and-access-management/aries-cloudagent-python"
}
1 Client --> Adapter:
{
"command": "initialize",
"arguments": {
"clientID": "vscode",
"clientName": "Visual Studio Code",
"adapterID": "python",
"pathFormat": "path",
"linesStartAt1": true,
"columnsStartAt1": true,
"supportsVariableType": true,
"supportsVariablePaging": true,
"supportsRunInTerminalRequest": true,
"locale": "en-us",
"supportsProgressReporting": true
},
"type": "request",
"seq": 1
}
3 Error:
{}
5 Client --> Adapter:
{
"command": "disconnect",
"arguments": {
"restart": false
},
"type": "request",
"seq": 2
}
6 Error:
{
"code": "EPIPE"
}
2508 Stopping Session如上面的日志文件所示,我得到和EPIPE错误。此外,调试器不附加到远程停靠程序进程。请有人帮一下这个错误是怎么回事。谢谢。
发布于 2020-12-01 20:43:12
当我让调试器侦听容器内的localhost而不是0.0.0.0时,我也遇到了同样的问题:
python -m debugpy --listen localhost:5678 myfile.py在0.0.0.0上运行它解决了这个问题:
python -m debugpy --listen 0.0.0.0:5678 myfile.pyhttps://stackoverflow.com/questions/64033751
复制相似问题