python - 等待调试器连接的 Visual Studio Code Python 超时

标签 python debugging visual-studio-code

我正在使用 Python 运行 visual studio 代码教程,但无法连接到调试器。当我搜索时,Google/SO 是空的。通常我将 Anaconda 与 Jupyter 一起使用,所以我将 Visual Studio Code 连接到我激活的 3.6 虚拟环境中的 python。我尝试在我的虚拟环境中通过 pip 安装 ptvsd,但这对我所看到的没有任何影响。

我欢迎任何建议。屏幕截图如下。底部屏幕截图中的 launch.json

enter image description here enter image description here

最佳答案

打开launch.json文件,添加如下配置:

{
    "name": "Python: Debug Console",
    "type": "python",
    "request": "launch",
    "program": "${file}",
    "console": "internalConsole"
}

当您为控制台指定 none internalConsole 时,它将在调试器控制台中运行调试器,而不是在内部或外部运行终端。

关于python - 等待调试器连接的 Visual Studio Code Python 超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52462599/

相关文章:

visual-studio - 在平板电脑而不是桌面上调试 VisualStudio

visual-studio-code - VSCode : can't figure out Hit Count condition

java - 如何修复 "{"名称“:"error","attributes": {"message" :"Exception happens in the Test Runner." in VS code

python - 如何在保持所述步骤之间关系的同时将长函数拆分为单独的步骤?

python - 如何在 python 中将数据框的邮政编码排序到 cargo 区域?

python - k-hot 编码来自多列的值

javascript - 如何在 VScode 中设置 typescript ?

python - 为什么 Pandas 分组聚合会丢弃分类列?

android - 如何在 Visual Studio Code 中为 React Native 设置调试?

c++ - 如何摆脱 Visual Studio 中的 "unsafe"警告/错误(strcpy、sprintf、strdup)