use*_*401 13 python debugging visual-studio-code
我正在使用Python运行visual studio代码教程,无法连接到调试器.当我搜索时,谷歌/ SO空无一人.通常我使用Anaconda和Jupyter,所以我在我激活的3.6虚拟环境中将Visual Studio Code连接到python.我尝试在我的虚拟环境中安装ptvsd,但这对我所看到的并没有什么影响.
我欢迎任何建议.屏幕截图如下.在底部截图中的launch.json
Luc*_*ath 25
打开lauch.json文件并添加以下配置:
{
"name": "Python: Debug Console",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "internalConsole"
}
Run Code Online (Sandbox Code Playgroud)
为控制台指定"none"时,它将在调试器控制台中运行调试器,而不是在内部或外部终端中运行.
我今天遇到了同样的问题。我认为当调试器尝试连接到 Visual Studio 中的集成 PowerShell 终端时,这可能是连接问题。如果我改为使用外部终端来运行程序,那么它可以正常工作,并且调试器连接到外部终端,我可以完美地调试。这是我的外部终端启动条目launch.json
{
"name": "Python: Terminal (external)",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "externalTerminal"
},
Run Code Online (Sandbox Code Playgroud)
小智 7
我遇到过同样的问题。通过使用“integratedTerminal”修复。
ps.我的系统win7
{
"name": "Debug",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/main.Py",
"console": "integratedTerminal"
}
Run Code Online (Sandbox Code Playgroud)
我有同样的问题,所以我在settings.json文件中添加了以下行
:
{
// to fix 'Timeout waiting for debugger connections'
"python.terminal.activateEnvironment": false
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11292 次 |
| 最近记录: |