Reputation: 1802
I have three classes having to import each others methods. The statements would be as follows in the corresponding files with classes:
File A with class a
from B import b
File B with class b
from C import c
File C with class c
from A import a
Why does this not work in python? I rather get the error message:
ImportError: cannot import name a
Upvotes: 0
Views: 93
Reputation: 11547
What you have is a classic circular import problem in Python. Have you taken a look at previous questions on SO, like this one?
Upvotes: 2
Reputation: 28304
Python can't find it. Is it in the proper directory, does it actually exist?
Upvotes: 0