等待调试器连接的 Visual Studio Code Python 超时 [英] Visual Studio Code Python Timeout waiting for debugger connection

查看:42
本文介绍了等待调试器连接的 Visual Studio Code Python 超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Python 运行 Visual Studio 代码教程,但无法连接到调试器.当我搜索时,Google/SO 空空如也.通常我将 Anaconda 与 Jupyter 一起使用,因此我将 Visual Studio Code 连接到激活的 3.6 虚拟环境中的 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆