Originally posted by **erelsgl** November 14, 2022
I have GUROBI installed, and MIP automatically detects it and uses it. How can I tell MIP to not use GUROBI?
I use the following code:
try:
model = mip.Model(name='', sense='MIN', solver_name='', solver=None)
except mip.InterfacingError:
model = mip.Model(name='', sense='MIN', solver_name='cbc', solver=None)
so that, if GUROBI is installed and its license is OK, it will run, otherwise MIP will use CBC.
It works, but I also get a lot of error messages:
Exception ignored in: <function SolverGurobi.del at 0x7f343cc4f9d0>
Traceback (most recent call last):
File "/mnt/d/Dropbox/ariel-algorithms/fairpy/.venv38linux/lib/python3.8/site-packages/mip/gurobi.py", line 439, in del
GRBfreeenv(self._env)
TypeError: initializer for ctype 'GRBenv ' must be a pointer to same type, not cdata 'GRBenv *'
Is there a way to suppress these error messages?
Discussed in https://github.com/coin-or/python-mip/discussions/313
I use the following code:
try: model = mip.Model(name='', sense='MIN', solver_name='', solver=None) except mip.InterfacingError: model = mip.Model(name='', sense='MIN', solver_name='cbc', solver=None) so that, if GUROBI is installed and its license is OK, it will run, otherwise MIP will use CBC.
It works, but I also get a lot of error messages:
Exception ignored in: <function SolverGurobi.del at 0x7f343cc4f9d0> Traceback (most recent call last): File "/mnt/d/Dropbox/ariel-algorithms/fairpy/.venv38linux/lib/python3.8/site-packages/mip/gurobi.py", line 439, in del GRBfreeenv(self._env) TypeError: initializer for ctype 'GRBenv ' must be a pointer to same type, not cdata 'GRBenv *' Is there a way to suppress these error messages?