diff --git a/docplex/util/cli.py b/docplex/util/cli.py index 88e1ca4..a5553c2 100644 --- a/docplex/util/cli.py +++ b/docplex/util/cli.py @@ -66,7 +66,7 @@ def get_cplex_info(): # way of unloading the 'cplex' module and since we will copy # a new shared object over the already loaded one, leaving the # cplex module loaded can create a segmentation fault. - out = subprocess.run(["python", "-c", sub_program], capture_output=True) + out = subprocess.run([sys.executable, "-c", sub_program], capture_output=True) if out.returncode == 0: stdout = out.stdout.decode("utf-8").strip().split(" ") if stdout[0] != "Error:": @@ -78,6 +78,10 @@ def copy_so(cos): cos = os.path.realpath(cos) pcplex, version = get_cplex_info() + if version is None: + print("ERROR: did not find 'cplex' package") + return + version_mneumonic = "".join(version.split(".")[:3]) so_name = get_so_name(version_mneumonic) cpo_name = get_cpo_name(version_mneumonic)