Skip to main content

Writing LP to an specific location

Answered

Comments

5 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 try Gurobot, our chatbot interface offering instant, expert-level support.
  • Jonasz Staszek
    • 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

    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

Post is closed for comments.