Error gurobipy "__init__() got an unexpected keyword argument 'bounds'"
Awaiting user inputHi, when i try to run the code in Spyder, this is what it gives me:

I cannot understand the error since the code was running in Visual Studio Code
-
Official comment
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support. -
Hi Joana,
if you want to add a variable using Gurobi Python API, you need to use its syntax.
Adding a single variable is usually done by the command model.addVar().
If you use a different modelling package, you need to refer to its documentation.
Best regards
Jonasz0 -
Hi! Thank you for your quick answer.
However, i tried the model.addVar() and it gives me this:
What should i do?
0 -
What is your \(model\) object? Is it a gurobipy model?
It needs to be one, otherwise the method won't work or its behavior could be different to what we expect to see.
Best regards
Jonasz0 -
My model object is defined as:
model = ConcreteModel()Is it a gurobipy model?RegardsJoana0 -
After a brief Google search I see that ConcreteModel() might be a pyomo-specific constructor.
Are you using pyomo? If yes, I would redirect you to consult pyomo's documentation for further clarifications. Perhaps this section will be of interest.
If that doesn't help, please share a minimal reproducible example of the code which throws this error.
Best regards
Jonasz0
Post is closed for comments.
Comments
6 comments