I have a folder structure in VS code as follows:
project
├── functions/
│ ├── __init__.py
│ ├── my_module.py
└── pipeline/
│ ├── __init__.py
│ ├── run_code.py
└── setup.py/
inside the run_code.py, it imports function from functions.my_module import new_func
.
however, it is giving ModuleNotFoundError
.
I tried below points:
- Added below in settings.json
"python.analysis.extraPaths`":["${workspaceFolder}"],
"launch": { "configurations": [],
"compounds": [],
"cwd": "${`workspace Folder\`}"
},
- tested with adding
sys.path.append()
at top and it worked. But this is not a standard way - Added init.py in each subfolders and it is not working
Kindly help.