Skip to main content

Unsupported operand type for =-: nonetype and float

Answered

Comments

3 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff
    This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?.
  • Jaromił Najman
    • Gurobi Staff

    Hi Matthijs,

    The error indicates that it comes from the wrong usage of the '-' operator. Are you sure that the error comes from the general constraints? Could you post the whole error message? Could you also provide a minimum working example which reproduces the error?

    Best regards,
    Jaromił

    0
  • Matthijs Smulders
    • Gurobi-versary
    • First Comment
    • First Question

    Hi Jaromil,

    I think I have found the problem myself. It appears that I accidentally set the value of dist_var somewhere in my code beforehand and it did not let me change it again (I mistyped the error in my title, it was a -= error). I have now changed it so that this does not occur.

    Thanks for your reply and sorry for your troube,

    Matthijs

    0

Post is closed for comments.