'How Can I fix "Can only add LpConstraintVar, LpConstraint, LpAffineExpression or True objects" error

Currently I have an LP model and while I'm trying to run it, the constraint

for i in DEMANDPOINT:
    prob += (lpSum(z[i][j]) == 1 for j in FACILITY5) 

causes this error to pop up.

TypeError: Can only add LpConstraintVar, LpConstraint, LpAffineExpression or True objects

How can I fix this? Thanks in advance



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source