Error trying to use Gurobi with Python-MIP: "function/symbol 'GRBloadenv' not found in library (error 0x7f)"
AnsweredAs I am trying to use Gurobi 12.0.0 with the lib Python-MIP, after installing both the lib and the solver in my computer, when I try to call the solver I am getting an error message.
My code:
from mip import *
import numpy as np
import gurobipy
model = Model(sense=MINIMIZE, solver_name='GUROBI')
AttributeError: function/symbol 'GRBloadenv' not found in library 'C:\gurobi1200\win64\bin\gurobi120.dll': error 0x7f
It's important to note that the dll correctly exists in the directory pointed above.
I have used the Python-MIP library with the CBC solver without issues, as well as the Gurobi solver with Pyomo. However, due to this error, I haven't been able to use Gurobi with Python-MIP.
What could be causing this issue, please?
Regards,
Eduardo
-
Hi Eduardo,
Please see the following note regarding GRBloadenv in the v12 release notes:
https://docs.gurobi.com/projects/optimizer/en/current/reference/releasenotes/knownbugs.html#missing-symbols-in-shared-library-libgurobi120Note that Python-MIP looks to be poorly maintained, with many pending pull requests. I expect you will need to wait till we publish 12.0.1 next year.
Kind Regards,
Riley0 -
I've created a fork of Python-MIP in which I've implemented the necessary changes:
https://github.com/venaturum/python-mip/tree/gurobi1200If you are installing with pip then you can use the following command:
pip install git+https://github.com/venaturum/python-mip.git@gurobi1200
If you are using a package manager other than pip then I suspect there will be a way to ask it to install a package directly from the branch of a repository, but you will have to investigate.
Note: this is valid for Gurobi 12.0.0 only! Once Gurobi 12.0.1 is released you should be able to resume using the current Python-MIP release.
- Riley
2 -
Thanks Riley! I created python-mip#398 to track this.
Cheers,
David1
Please sign in to leave a comment.
Comments
3 comments