Can’t get VSCode/Python debugger to find my project modules

A simple workaround to the bug mentioned by @BrettCannon is to add the following env entry to the launch.json configuration:

{
    "version": "0.2.0",
    "configurations": [
        {
           "name": "Python: Current File",
           "type": "python",
           "request": "launch",
           "program": "${file}",
           "console": "integratedTerminal",
           "env": { "PYTHONPATH": "${workspaceRoot}"}
        }
    ]
}

Leave a Comment