VS Code 不支持配置的调试类型“python”

use*_*581 16 debugging python-3.x visual-studio-code vscode-debugger

我在使用 VS code 进行调试时遇到问题。我已经为 vs code 扩展安装了 python 并重新加载了几次。但是当我尝试在调试模式下运行时,出现以下错误

The debug type is not recognized. Make sure that you have a corresponding debug extension installed and that it is enabled.
Run Code Online (Sandbox Code Playgroud)

我的launch.json有以下内容

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
    
    {
        "name": "Python : Fichier actuel",
        "type": "python",
        "request": "launch",
        "program": "${file}",
        "console": "integratedTerminal"
    }
]
}
Run Code Online (Sandbox Code Playgroud)

可能是什么问题?

小智 18

我遇到了同样的问题,并通过在 VS Code 中卸载 Python 和 Jupyter Notebook 扩展然后重新安装来解决。请注意,现在需要 Jupyter Notebook 才能在 VS Code 中使用 Python 扩展。


Ale*_* QA 8

此问题是 VS Code 的错误,已在2021 年 12 月早期版本 (v1.63)中得到解决。该警告没有任何影响,运行代码没有任何实际问题。所以,不用理会,过不了多久就会修复的。

编辑说明:添加、删除、安装或禁用/启用 Jupyter Notebook 及其相关扩展似乎可以解决问题,但只能等到下一次 VS Code 重新启动为止。

  • 我可以确认 v1.63 版本解决了该问题。 (2认同)