Skip to main content

Error gurobipy "__init__() got an unexpected keyword argument 'bounds'"

Awaiting user input

Comments

5 comments

  • Jonasz Staszek
    Community Moderator Community Moderator
    Gurobi-versary
    Thought Leader
    First Question

    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
    Jonasz

    0
  • Joana Domingos
    Gurobi-versary
    First Question
    First Comment

    Hi! Thank you for your quick answer.
    However, i tried the model.addVar() and it gives me this:

    What should i do?

    0
  • Jonasz Staszek
    Community Moderator Community Moderator
    Gurobi-versary
    Thought Leader
    First Question

    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
    Jonasz

    0
  • Joana Domingos
    Gurobi-versary
    First Question
    First Comment

    My model object is defined as: 

    model = ConcreteModel()
     
    Is it a gurobipy model?
     
    Regards
    Joana
    0
  • Jonasz Staszek
    Community Moderator Community Moderator
    Gurobi-versary
    Thought Leader
    First Question

    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
    Jonasz

    0

Please sign in to leave a comment.