opencobra / cobrapy

COBRApy is a package for constraint-based modeling of metabolic networks.
http://opencobra.github.io/cobrapy/
GNU General Public License v2.0
455 stars 211 forks source link

How to set the model solver #1333

Closed brunorbqi closed 1 year ago

brunorbqi commented 1 year ago

Checklist

Question

How can I set a solver other than gurobi for cobrapy ? In the cobrapy documentation says that glpk solver is used as default, but always when I load a model in cobrapy, shows that gurobi is being used. Once my license have expired I could not use cobrapy funcions. I tried use the 'model.solver = glpk' but not worked. There is any way other than model.solver to set the solver in cobrapy? Because even when others solvers are available looks like the gurobi overlaps. Best regards.

cdiener commented 1 year ago

Your syntax is slightly off. It would be model.solver = "glpk". Alternatively if you uninstall gurobi from your python environment it will use GLPK by default.