I have the following dir structure
mainpackage
├── __init__.py
└── subpackage
├── __init__.py
└── module.py
Module.py contains
def test():
print("test called")
Using python3 I am looking to make the module.py module available for import in the mainpackage namespace. So far my mainpackage __init__.py file looks like this
from .subpackage import module
I would like to be able to call
import mainpackage.module
but this throws
ImportError: No module named 'mainpackage.module'
Just for clarity, I am NOT looking to import the test function into the mainpackage namespace - I want the entire module. Is this possible ? Any help would be much appreciated.