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
-
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
Please sign in to leave a comment.
Comments
5 comments