Reputation: 6544
structure:
app
app/__init__.py
app/mymodule.py
app/myscript.py
mymodule.py:
class One: pass
myscript.py:
from .mymodule import One
And I see an error:
SystemError: Parent module '' not loaded, cannot perform relative import
Why? I read this and this, but I cant understand, how to fix it. Please, explain me. Thanks.
Upvotes: 1
Views: 264
Reputation: 43225
from .mymodule import One
needs to be from mymodule import One
( remove the dot)
Upvotes: 1