Hi,
Sorry, my post earlier was not correct:
First note: Pi is only available for continuous models after optimize() has been called.
> solution = Constr.getAttr('Pi’)
This should work fine. If Constr is one Gurobi constraint object (and not a list of Gurobi constraints).
> or
> solution = Var.getAttr('Pi’)
This should give you the following error:
gurobipy.GurobiError: Attribute pi is not a Var attribute
> Error message said "File "constr.pxi", line 58, in gurobipy.Constr.getAttr (../../src/python/gurobipy.c:11348)
> TypeError: getAttr() takes exactly %Id positional argument%s (%Id given)".
This looks strange, which Gurobi version are you using? What is your OS? And what kind of Python are you running?
Thanks,
Sonja