python - Visual Studio Code Python 超时等待调试器连接
问题描述
我正在使用 Python 运行 Visual Studio 代码教程,但无法连接到调试器。当我搜索时,Google / SO 出现空缺。通常我将 Anaconda 与 Jupyter 一起使用,因此我在激活的 3.6 虚拟环境中将 Visual Studio Code 连接到 python。我尝试在我的虚拟环境中 pip 安装 ptvsd,但这并没有改变我所看到的。
我欢迎任何建议。截图如下。底部屏幕截图中的 launch.json
解决方案
打开launch.json
文件并添加以下配置:
{
"name": "Python: Debug Console",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "internalConsole"
}
当您为控制台指定时,它将在调试器控制台中运行调试器,而不是在内部或外部终端中运行。none
internalConsole
推荐阅读
- java - 在没有版本注释或 OptimisticLocking 策略的情况下获取 ObjectOptimisticLockingFailureException
- reactjs - 反应错误:未定义 web3' no-undef
- javascript - 是否可以在 webOS TV App 中获取用户的地理位置?
- android - 无法使用 File Provider 从内部存储打开 PDF 以在 Android 8 和 9 上查看
- xcode - 设置 NSStepper 的尺寸
- java - Java 8 32 位 - 无法初始化 JCE
- c# - Outlook 会议事件 onSend
- python - python)使用正则表达式查找所有匹配项(从 re.search 更改为 re.findall)
- r - 重命名文件夹中的多个文件
- javascript - 鼠标单击和 TF 更新时图像消失