From 6ef67a6811eb3669762dda83eef9c06364c80329 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 31 Jul 2024 10:17:17 +0200 Subject: [PATCH] fix UnboundLocalError: cannot access local variable 'mip' error --- mip/model.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mip/model.py b/mip/model.py index 9fa011b7..654c506e 100644 --- a/mip/model.py +++ b/mip/model.py @@ -106,6 +106,8 @@ def __init__( self.solver = mip.cbc.SolverCbc(self, name, sense) self.solver_name = mip.CBC + else: + import mip # list of constraints and variables self.constrs = mip.ConstrList(self)