I've gone through a lot of resources, but I simply cannot get this to work. I am trying to do an absolute import for some config files and library class files of my own, but the import fails. Here is a simple example:
└── import_test
├── __init__.py
├── config
│ ├── __init__.py
│ └── database.py
└── services
├── __init__.py
└── data.py
Here is the database.py
mysql = {'host': 'localhost',
'user': 'root',
'passwd': 'password',
'db': 'db_name',
'charset': 'utf8'}
and here is data.py
from import_test.config import database
When I run the data.py, I get this error.
ModuleNotFoundError: No module named 'import_test'
What am I doing wrong?
Thanks!