I can't set up Gurobi in python with Anaconda using its integrated IDE Spyder

706 views
Skip to first unread message

Hanzel Grillo Espinoza

unread,
Jun 14, 2016, 11:13:28 AM6/14/16
to Gurobi Optimization
Hello guys
I am trying to model a problem by using Gurobi in Python.
I have red a few tutorials where they recommend to use the mix Gurobi-Python-Anaconda-Spyder.
It seems very clear and easy to set up according with the tutorials and the instructions in the website of Gurobi.
But I have followed each steo, one by one, several times and I alway have problems.
When I write the sentence "from gurobipy import *" in Spyder, it returns a warning saying "'from gurobipy import *' used; unable to detect undefined"

Since it is a warning, I continue coding and when I write
m = Model('m')
m.Params.UpdateModel = 1

and I execute, it returns an error saying "No parameters matching 'UpdateModel' found".

I have tried everything, chaging the environment path, uninstall and reinstall, anaconda, and gurobi several times, but nothing works.

Can someone help me with this issue?

Renan Garcia

unread,
Jun 14, 2016, 11:15:02 AM6/14/16
to gur...@googlegroups.com
The parameter name is 'UpdateMode' (see http://www.gurobi.com/documentation/6.5/refman/updatemode.html#parameter:UpdateMode), not 'UpdateModel'.

--

---
You received this message because you are subscribed to the Google Groups "Gurobi Optimization" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gurobi+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hanzel Grillo Espinoza

unread,
Jun 14, 2016, 11:31:21 AM6/14/16
to Gurobi Optimization
Hello Renan
Thanks a lot.
But, what about the warning while importing the gurobipy?
I have the feeling that something is wrong with that because for example when I want to see the elements of the gurobipy module
for example, I have to type "m." and it is suppose that the autocomplete tool would show the list of options like "addConst..". But when I type "m." it happens nothing.
Any idea?

Renan Garcia

unread,
Jun 14, 2016, 11:45:25 AM6/14/16
to gur...@googlegroups.com
I think some IDEs don't do much in terms of detection if you use an import statement like

  from gurobipy import *

My guess is if you try importing individual objects with statements like

  from gurobipy import Model, Var, Constr

Spyder will be more successful at autocompletion.

Hanzel Grillo Espinoza

unread,
Jun 15, 2016, 9:48:44 AM6/15/16
to Gurobi Optimization
Perfect, thanks a lot Renan.
Reply all
Reply to author
Forward
0 new messages