from pathlib import Path base_dir = Path(__file__).parent.parent print(base_dir)