VS Code Python Timeout waiting for debugger connection

旧街凉风 提交于 2020-01-16 18:06:08

问题


Yesterday, before Visual Studio Code updated itself (from 1.27.2 to 1.28.2), I could open it from an anaconda prompt after activating a certain environment and debug a script. Now when I try to debug a script, I get an error about a Timeout waiting for debugger connection.

I've followed some advice on another thread (Visual Studio Code Python Timeout waiting for debugger connection) and can get it to work if I use the configuration below, but it still seems to be a problem that it won't run in an integrated terminal anymore.

This used to work but breaks now:

{
    "name": "Python: Current File (Integrated Terminal)",
    "type": "python",
    "request": "launch",
    "program": "${file}",
    "stopOnEntry": true,
    "console": "integratedTerminal"
},

This works now if I want to run in debugger console.

{
    "name": "Python: Debug",
    "type": "python",
    "request": "launch",
    "program": "${file}",
    "stopOnEntry": true,
    "console": "none"
},

回答1:


I had the same issue and to fix that I added following line to the settings.json file:

{
    // to fix 'Timeout waiting for debugger connections'
    "python.terminal.activateEnvironment": false
}


来源:https://stackoverflow.com/questions/52881801/vs-code-python-timeout-waiting-for-debugger-connection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!