VS Code Python超时等待调试器连接 [英] VS Code Python Timeout waiting for debugger connection
问题描述
昨天,在Visual Studio Code自我更新(从1.27.2到1.28.2)之前,我可以在激活特定环境并调试脚本后从anaconda提示符下打开它.现在,当我尝试调试脚本时,出现有关超时等待调试器连接的错误.
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.
我已经在另一个线程上遵循了一些建议( VisualStudio Code Python超时等待调试器连接),如果我使用以下配置,则可以使其正常工作,但是仍然无法在集成终端中运行仍然是一个问题.
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"
},
推荐答案
我遇到了同样的问题,并解决了将以下行添加到 settings.json
文件中的问题:
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
}
这篇关于VS Code Python超时等待调试器连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!