I have the following structure:
Common
| - - - - __init__.py
| - - - - ConfigHelper.py
scripts
| - - - - main.py (from ConfigHelper import Config) (It does not creates error)
| - - - - utils/
| - - - - shared_db_connection_repository.py
I am importing a class from ConfigHelper file in various different files located in the same utils and scripts directory.
I am importing using the following code from Common.ConfigHelper import Config, which is correctly get accessed in the main file.
But it creates error when accessed with the same method inside files present under utils directory.
I have added Common in the extraPaths inside settings.json so VS code does able to locate the reference, but when I run the script using python -u "absolute-path-to-file" it creates error:
shared_db_connection_repository.py", line 6, in <module>
from Common.ConfigHelper import Config
ModuleNotFoundError: No module named 'Common'