问题
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