I know this has been asked many times but somehow I am not able to get over this error. Here is my directory structure-
project/
pkg/
__init__.py
subpackage1/
script1.py
__init__.py
subpackage2/
script2.py
__init__.py
script2.py has:
class myclass:
def myfunction:
script1.py has
from ..subpackage2 import script2
I also tried
from ..subpackage2 import myclass
And this gives me : ValueError: Attempted relative import in non-package
Any help would be really appreciated.