Im trying to import functions from others files in other directory, but take error ModuleNotFoundError
Test structure:
py_path/
p1/
__init__.py
s1.py
p2/
__init__.py
s2.py
__init__.py
py_path/__init__.py
:
from . import p1, p2
py_path/p1/__init__.py
:
from s1 import *
py_path/p1/s1.py
:
from .p2 import s2
f2()
py_path/p2/__init__.py:
from s2 import *
py_path/p2/s2.py:
def f2():
print('test func in s2.py')
How import module from other file?