Visual Studio Code Python超时等待调试器连接 [英] Visual Studio Code Python Timeout waiting for debugger connection
问题描述
我正在使用Python运行Visual Studio代码教程,并且无法连接到调试器。当我搜索时,Google / SO变成空白。通常我将Anaconda与Jupyter结合使用,因此我将在激活的3.6虚拟环境中将Visual Studio Code连接到python。我尝试在虚拟环境中pip安装ptvsd,但这并没有改变我所看到的内容。
I'm running the visual studio code tutorial with Python and am unable to connect to the debugger. Google / SO are coming up empty when I search. Usually I use Anaconda with Jupyter, so I'm connecting Visual Studio Code to the python in my activated 3.6 virtual environment. I tried pip installing ptvsd in my virtual environment, but that did not make a difference in what I am seeing.
我欢迎任何建议。屏幕截图如下。底部屏幕截图中的launch.json
I would welcome any suggestions. Screenshots included below. launch.json in the bottom screenshot
推荐答案
打开 launch.json
文件并添加以下配置:
Open the launch.json
file and add the following configuration:
{
"name": "Python: Debug Console",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "internalConsole"
}
当您指定 none
internalConsole
作为控制台,它将在调试器控制台中运行调试器,而不是在内部或外部终端中运行。
When you specify none
internalConsole
for the console, it will run the debugger in the debugger console instead of running in the internal or external terminal.
这篇关于Visual Studio Code Python超时等待调试器连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!