Reputation: 64356
I have folder with such structure:
parent/
---__init__.py
---SomeClass.py
---Worker.py
First file (__init__.py
) is empty.
Second file (SomeClass.py
) content is following code:
class Test:
pass
Third file (Worker.py
):
import SomeClass
Test()
ImportError: No module named SomeClass
What I do wrong?
Upvotes: 2
Views: 360
Reputation: 4485
Try
from . import SomeClass
but remember you'll have to
SomeClass.Text()
instead of just Test()
Upvotes: 1