How to import components on the parent directory
import sys
sys.path.append(os.pardir)
How to import components on the same layer directory on the parent directory
import sys
sys.path.append(f"{os.pardir}/directory2")
import sys
sys.path.append(os.pardir)
import sys
sys.path.append(f"{os.pardir}/directory2")