From 3552975ceeed58aa1c45cec58dec6fcae7557827 Mon Sep 17 00:00:00 2001 From: Abdallah Ammar Date: Fri, 1 Nov 2024 10:59:35 +0100 Subject: [PATCH] ensure QUACK_ROOT is defined --- PyDuck.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PyDuck.py b/PyDuck.py index 7a0e40a..6c39b70 100644 --- a/PyDuck.py +++ b/PyDuck.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -import os +import os, sys import argparse import pyscf from pyscf import gto @@ -8,6 +8,10 @@ import numpy as np import subprocess #Find the value of the environnement variable QUACK_ROOT. If not present we use the current repository +if "QUACK_ROOT" not in os.environ: + print("Please set the QUACK_ROOT environment variable, for example:\n") + print("$ export QUACK_ROOT={0}".format(os.getcwd())) + sys.exit(1) QuAcK_dir=os.environ.get('QUACK_ROOT','./') #Create the argument parser object and gives a description of the script