This article helped me by fixing this exception. The following code gave this exception
... from a import A class B (A): ...
but this was wrong because my class had the same name as the file it was in. This meant that my class had the same name as the module. To make it right it should be:
... from a import A class B (A.A): ...