18

I have issues debugging with VS code. I have installed python for vs code extension and reloaded it several time. But when I tried to run in the debug mode, I have the following error

The debug type is not recognized. Make sure that you have a corresponding debug extension installed and that it is enabled.

My launch.json has the following contain

{
// 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"
    }
]
}

What could be the issue?

4 Answers 4

21

I had the same problem and was able to solve it by uninstalling Python and Jupyter Notebook extensions in VS Code and then re-installing them. Note that Jupyter Notebook is now required to use the Python extension in VS Code.

Sign up to request clarification or add additional context in comments.

3 Comments

I was using open source Codium and the Python extension was not installed out-of-the-box.
Uninstalling Jupyter seemed to fix it for me, but then the problem was back the next day when I started vscode again.
@ChrisProsser - same here. After closing/reopening vs code. No issues running the config though. Only being flagged in the edtor
8

This issue is a VS Code bug, it is being solved in an early Dec-2021 release (v1.63). The warning has no effect whatsoever, there are no real issues running the code. So, don't pay attention to it, it will be fixed in a short time.

Edit note: Adding, removing, installing, or disabling/enabling the Jupyter Notebook and its related extensions seem to solve the problem but only until the next VS Code restart.

1 Comment

I can confirm that release v1.63 fixed the issue.
1

I had this same problem. The easiest way for me to fix it, was to:

  • go to the Python file in the file explorer,
  • right click, and choose "run current file in interactive window".

After that selection, VSCode prompted me that

X,Y,Z, will need to be installed and configured".

I did that, and then everything worked just fine!

Comments

0

I had the same problem, but I think it came from using virtualenvwrapper:

when creating virtual environments using mkvirtualenv the virtual environment is not placed inside the project folder (e.g. in a folder .venv), but gathered in a central place defined by the $WORKON_HOME user environment, which has to be defined during installation of virtualenvwrapper.

So far, so good - but VSCode has to be told, where this central folder lies. At least this was what solved the problem for me. So:

  • open the settings of the Python extension (search for Python (by Microsoft) and click on the gearwheel next to the Python icon -> Extension settings)
  • in the search bar type @ext:ms-python.python venv
  • in the User settings in section "Python: Venv Path" enter the directory where all your virtual environments lie (= $WORKON_HOME)

After that I restarted VSCode and it didn't complain anymore in the launch.json file (or in my case, the .code-workspace file), VSCode immediately found the python interpreter in the virtual environment and everything worked fine again.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.