I have a script named main.py that imports script1.py from a dir named folder.
This script1.py imports another script named script2.py that resides in the same folder directory.
Here is the code:
main.py
import folder.script1 as s1
s1.func()
folder/script1.py
import script2 as s2
def func():
s2.func()
folder/script2.py
def func():
print('Ciao')
When I run main.py I get the error:
Traceback (most recent call last):
File "C:\try.py", line 1, in <module>
import folder.script1 as s1
File "C:\folder\script1.py", line 1, in <module>
import script2 as s2
ModuleNotFoundError: No module named 'script2'
Is there a nice way to make this work or should I change approach?