Skip to content

Commit 1e9207c

Browse files
feat: add error message if highspy not installed (#491)
1 parent a26d3dc commit 1e9207c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

linopy/solvers.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,10 @@ def solve_problem_from_file(
458458
status.legacy_status = first_line
459459

460460
# Use HiGHS to parse the problem file and find the set of variable names, needed to parse solution
461+
if "highs" not in available_solvers:
462+
raise ModuleNotFoundError(
463+
f"highspy is not installed. Please install it to use {self.solver_name.name} solver."
464+
)
461465
h = highspy.Highs()
462466
h.silent()
463467
h.readModel(path_to_string(problem_fn))

0 commit comments

Comments
 (0)