Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gurobipy 12.0 error D: #273

Open
Paulocracy opened this issue Nov 14, 2024 · 0 comments
Open

gurobipy 12.0 error D: #273

Paulocracy opened this issue Nov 14, 2024 · 0 comments

Comments

@Paulocracy
Copy link

With the newest gurobipy version 12.0 that was released just 2 days ago, optlang returns the following error and stops due to a change in gurobipy's addConstr() function. Here's the relevant part of this error (used from within CNApy->cobrapy->optlang):

File "/.../cnapy-dev-310/lib/python3.10/site-packages/cobra/core/model.py", line 755, in add_reactions
    self._populate_solver(pruned)
  File "/.../cnapy-dev-310/lib/python3.10/site-packages/cobra/core/model.py", line 1130, in _populate_solver
    if reaction.id not in self.variables:
  File "/.../envs/cnapy-dev-310/lib/python3.10/site-packages/cobra/core/model.py", line 1015, in variables
    return self.solver.variables
  File "/.../envs/cnapy-dev-310/lib/python3.10/site-packages/optlang/interface.py", line 1248, in variables
    self.update()
  File "/.../envs/cnapy-dev-310/lib/python3.10/site-packages/optlang/gurobi_interface.py", line 671, in update
    super(Model, self).update(callback=self.problem.update)
  File "/.../envs/cnapy-dev-310/lib/python3.10/site-packages/optlang/interface.py", line 1473, in update
    self._add_constraints(add_constr)
  File "/.../envs/cnapy-dev-310/lib/python3.10/site-packages/optlang/gurobi_interface.py", line 728, in _add_constraints
    self.problem.addConstr(lhs, sense, rhs, name=constraint.name)
  File "src/gurobipy/_model.pyx", line 3894, in gurobipy._model.Model.addConstr
TypeError: addConstr() takes at most 3 positional arguments (4 given)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant