import shutil from common.exceptions import SolverNotFoundError def check_solver(): # Check if solver 'ipopt' is on path solver_path = shutil.which('ipopt') if not solver_path: raise SolverNotFoundError