The answers to this question have led me to believe that circular imports of modules should work, but I am running into trouble with the following package:
File structure:
my_package
--| my_package
|-- __init__.py
|-- mod1.py
|-- mod2.py
--| setup.py
__init__.py
:
from . import mod1, mod2
mod1.py
:
from . import mod2
mod2.py
:
from . import mod1
Trying to import the package gives the error:
ImportError: cannot import name 'mod1'
What can I do to make these imports work?