I have the following file structure:
And I don't know why this piece of code doesn't work:
# this is in main.py
import sys
from pathlib import Path
main = Path(__file__).parents[2]
if main not in sys.path:
sys.path.insert(0, main)
print(main)
from mainFolder.dir1.subdir1 import forImport
Comparing it to this Import module from subfolder I can't explain myself what I am doing wrong.
Thank you in advance!