Skip to main content

How do I save file after finished analysis model in Terminal?



1 comment

  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    You can use the write method to write an LP or an MPS file of your model.

    An example input would be

    Gurobi Interactive Shell (mac64), Version 9.5.0
    Copyright (c) 2021, Gurobi Optimization, LLC
    Type "help()" for help

    gurobi> model=Model("test")
    gurobi> x = model.addVar()
    gurobi> model.setObjective(x)
    gurobi> model.write("myLP.lp")

    This writes your current model to an LP file called \(\texttt{myLP}\).

    Best regards,


Please sign in to leave a comment.