def get_petsc_dir():
    try:
        arch = '/' + os.environ.get('PETSC_ARCH', '')
        dir = os.environ['PETSC_DIR']
        return (dir, dir + arch)
    except __HOLE__:
        try:
            import petsc
            return (petsc.get_petsc_dir(), )
        except ImportError:
            sys.exit("""Error: Could not find PETSc library.

Set the environment variable PETSC_DIR to your local PETSc base
directory or install PETSc from PyPI: pip install petsc""")
dataset/ETHPy150Open OP2/PyOP2/pyop2/utils.py/get_petsc_dir