Here is my folder structure:
__init__.py --> has "class SimulatorException(Exception):"
from pt_hil.utilities.PT_HIL_dSPACE_Utils.exception import SimulatorException
from exception import SimulatorException
One of the purposes of a
__init__.py file, is to mark the directory as a valid Python package that you can
You only declared the
exception folder to be a valid Python package and therefore that's the root package you can start importing from.
It's either you create top level packages by adding empty
__init__.py files to each top level folder you have and then can import as you originally wanted, or keep the current structure and import directly from