My Python project folder structure is as follow:
.python_practice
|--lib
|--lib.py
|--__init__.py
|--practice1
|--my_module.py
|--__init__.py
|--__init__.py
My launch configuration is
{
"name": "Python: Module",
"type": "python",
"request": "launch",
"module": "practice1.my_module",
"console": "integratedTerminal"
},
In my_module.py
from lib.lib import util_func
When I try to debug using VScode I get an error: "No module named practice1.my_module"
But when I run it with the following command it works fine
python -m practice1.my_module
How could I debug my code so that the relative import work?
Any help will be appreciated, thank you.