I have this simple project structure:
main
__init__.py
animal.py (class Animal)
sub1
__init__.py
cat.py (class Cat)
sub2
__init__.py
dog.py (class Dog)
Each __init__.py
file is empty.
So,
- from
dog.py
I need to importAnimal
class
Using this syntax:
from animal import Animal
I got
ImportError: No module named animal
- from
dog.py
I need to importCat
class insub1.cat
module
Using this syntax:
from sub1.cat import Cat
I got
ImportError: No module named sub1.cat
How can I do this?