Here's my directory structure -
src
Main.py
Message.py
...
__init__.py
In Main.py, I have an import statement import src.Message. This works fine when I execute the file on my own using the command python3 -m src.Main.py
However, when I use the VS code debugger to do the same, I get a ModuleNotFoundException.
I assumed that this was because the debugger doesn't use the -m flag, so I used the run Module configuration in the VS Code debugger.
I entered src.Main.py in that, and while the program does start, the debugger is unable to connect to it, and I get an error a few seconds later.
