pythonvisual-studio-code

Why is it vscode python could not find debugpy path when running without debugging?


screenshot of error message

I'm relatively new to platforms like vscode, and I seem to run into problems whenever I try to run a python program without debugging (Ctrl + F5). A window pops up saying "Could not find debugpy path" and gives me the option of either opening launch.json or cancelling. Running from the "run file" button on the right works, so I'm just curious what is causing this problem.

I opened launch.json and it's mostly empty:

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

screenshot of launch.json


Solution

  • Turns out I needed to download a Python debugger in the VSCode extensions. I used Python Debugger from Microsoft.

    image of the extension