'/Users/stephenchapman/gurobi.lic', (The solver is under '/Users/stephenchapman/Applications/'.
After loading the model
import cobra
import os
from os.path import join
data_dir = '/Users/stephenchapman/Documents/FBA_algae_digesate/COBRApy/models/iRC1080/'
model = cobra.io.read_sbml_model(join(data_dir, "IRC1080_SC_correctedPSII.xml"))
model
#<Model iRC1080 at 0x11ffc6048>
I then go to change solver:
model.solver ='gurobi'
and receive this error:
Traceback (most recent call last):
File "/Users/stephenchapman/anaconda/lib/python3.6/site-packages/cobra/core/model.py", line 138, in solver
interface = solvers[interface_to_str(value)]
KeyError: 'gurobi'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/stephenchapman/anaconda/lib/python3.6/site-packages/cobra/util/context.py", line 69, in wrapper
f(self, new_value)
File "/Users/stephenchapman/anaconda/lib/python3.6/site-packages/cobra/core/model.py", line 140, in solver
raise not_valid_interface
cobra.util.solver.SolverNotFound: gurobi is not a valid solver interface. Pick from ['glpk', 'scipy'], or specify an optlang interface (e.g. optlang.glpk_interface).
Can anyone help me here?
Kind regards
S.
Hello Stephen,
Can you ensure that optlang recognizes Gurobi, please? I feel this may be easier discussed in an issue (easier to handle code examples there). Could you open one at https://github.com/opencobra/cobrapy/issues, please? I'm especially interested in the output of cobra.show_versions(). And please try to import optlang.gurobi_interface as gurobi;gurobi.Model() in your environment and put that into the new issue, too.
Thank you,
Moritz
--
You received this message because you are subscribed to the Google Groups "cobra pie" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cobra-pie+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.