I've looked at so many stackoverflow posts but I don't understand why I'm getting this problem
My file system
parent_folder
|folder1
|module1.py
|module2.py
|__init__.py
|folder2
|main.py
I want to import module1.py and module2.py into main.py.
My __init__.py file has the following
__all__=['module1','module2']
Here is what I'm trying in main.py
from ..folder1 import *
But this give me this error:
Traceback (most recent call last):
File "main.py", line 2, in <module>
from ..folder1 import *
SystemError: Parent module '' not loaded, cannot perform relative import
I've been trying to solve this for an hour and nothing is working. Please help.
edit: I solved this by using absolute path (nothing else was working)