When I try to access a sub-directory module from another sub-directory module it keep shows:
ModuleNotFoundError: No module named 'folder_1'
My current folders structure looks like this:
.
├── main.py (updated)
├── folder_1
│ ├── file1.py
│ └── __init__.py
└── folder_2
├── file2.py
└── __init__.py
From file1.py
:
def abc():
return True;
From folder_1/__init__.py
from . import file1
From folder2/file2.py
:
from folder_1.file1 import abc
Is this the wrong way to access sub-folder module from another sub-folder?