How to debug a Python module in Visual Studio Code’s launch.json

Actually, there is a very simple option to do this I found by accident while trying to edit the launch.json file.

"type": "python",
"request": "launch",
"pythonPath": "D:\\ProgramData\\Anaconda3\\envs\\simulec\\python.exe",
"module": "my_module.my_file",

Simply specify the module in the module key "module": "my_module.my_file"

The -m is not useful any more.

Leave a Comment