Possible Duplicate:
Python: Circular (or cyclic) imports
Circular dependency in Python
I have a Python package featuring two modules that import each other. That is, in module A we have the line
from B import b
and in module B we have the line
from A import a
When I try to load the package containing these modules I get the following error
ImportError: cannot import name a
Is there a way to avoid this error (without combining the two modules into one big module AB)?