import sys from pathlib import Path # hack to add the parent directory to the path -> pypho doesn't have to be installed as package parent_dir = Path(__file__).parent while not (parent_dir / "pypho" / "pypho").exists() and parent_dir != Path("/"): parent_dir = parent_dir.parent print(f"Adding '{parent_dir / "pypho"}' to 'sys.path' to enable import of '{parent_dir / 'pypho' / 'pypho'}'") sys.path.append(str(parent_dir / "pypho"))