Skip to main content

Writing LP to an specific location

Answered

Comments

4 comments

  • Jonasz Staszek
    Community Moderator Community Moderator
    Gurobi-versary
    Thought Leader
    First Question

    Hi Jose!

    Gurobi staff will be better positioned to answer whether the target path can be changed inside of

    model.write()

    method, but - as a workaround - you can use Python's standard shutil package.

    For a tutorial on how to copy a file to a different location using shutil, go here.

    Best regards,
    Jonasz

    0
  • Jose Vindel
    Gurobi-versary
    Thought Leader
    Investigator

    Hello Jonasz,

    Thanks for the tutorial, it is definitely a workaround I could work with.

    Hopefully, Gurobi staff can provide insight as I am quite sure I am not the only one who would like to save the files in a different folder.

     

    Best wishes

    Jose  

    0
  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Hi Jose,

    The write method writes the file to the specified folder (or current location on default). Do you have writing permissions in your folder? Did you execute your script as an administrator?

    Best regards, 
    Jaromił

    0
  • Jose Vindel
    Gurobi-versary
    Thought Leader
    Investigator

    Hello Jaromil, 

    No, I did not execute my script as administrator I ran it normally from the command terminal (windows). I will try to run it as an administrator. So, one can include a path in the method, similar to what I wrote in my first comment.

    0

Please sign in to leave a comment.