Same as what mentioned in this answer by Scott.
I was looking for how to solve this issue of relative paths. This article showed to me how it is done. https://k0nze.dev/posts/python-relative-imports-vscode/
So you need to use the "env"
key in launch.json to add your workspace directory to the PYTHONPATH
and voila!
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Module",
"type": "python",
"request": "launch",
"program": "${file}",
"env": {"PYTHONPATH": "${workspaceFolder}"}
}
]
}