Let's say I have the following directory structure:
a
__init__.py
b
__init__.py
c
__init__.py
c_file.py
d
__init__.py
d_file.py
In the a
package's __init__.py
, the c
package is imported. But c_file.py
imports a.b.d
.
The program fails, saying b
doesn't exist when c_file.py
tries to import a.b.d
. (And it really doesn't exist, because we were in the middle of importing it.)
How can this problem be remedied?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…