Python 使用ptvsd远程调试Docker容器不';不要在断点上停止

Python 使用ptvsd远程调试Docker容器不';不要在断点上停止,python,docker,visual-studio-code,Python,Docker,Visual Studio Code,我尝试使用VS代码和ptvsd调试在Docker容器上启动的程序 调试器配置: "name": "Attach (Remote Debug)", "type": "python", "request": "attach", "port": 9091, "host": "localhost", "pathMappings": [ { "localRoot": "${workspaceFolder}", "remoteRoot": "/usr/src" }

我尝试使用VS代码和ptvsd调试在Docker容器上启动的程序

调试器配置:

"name": "Attach (Remote Debug)",
"type": "python",
"request": "attach",
"port": 9091,
"host": "localhost",
"pathMappings": [
    {
       "localRoot": "${workspaceFolder}",
       "remoteRoot": "/usr/src"
    }
]
应调试的文件:

import ptvsd
ptvsd.enable_attach(address=('0.0.0.0', 9091))
ptvsd.wait_for_attach()

while True:
    print('elo') # breakpoint is set here
我使用打开的端口9091运行容器,并在容器内编写代码。然后启动调试器。 调试器已连接,但它不会在断点处停止并运行无限循环

ptvsd安装在本地和远程上,版本相同-4.2.7

应该更改什么以使调试器在断点上停止