Skip to main content

Gurobi Write error

Answered

Comments

4 comments

  • Marika Karbstein
    Gurobi Staff Gurobi Staff

    Hi,

    gurobi_write(model, 'mymodel.mps.bz2')

    writes the model as mps and then compresses it. It is probably not necessary to use both commands:

    gurobi_write(model, 'mymodel.mps');
    gurobi_write(model, 'mymodel.mps.bz2');

    because both write the same mps file, the latter also compresses it.

    You get the error because you do not have the appropriate compressing tool installed. So you need to install for example bzip2 or might use a different compression algorithm with a different file extension ('7z', 'zip').

    Best regards,
    Marika

    0
  • Felix Preuschoff
    First Comment
    Gurobi-versary
    First Question

    I currently have the same error in matlab 2024b on win 11 and not one compression tool works. 7z is installed and zip support is shipped with windows as a standrad right? On linux, using the latest matlab/gurobi combination, this works.

    0
  • Felix Preuschoff
    First Comment
    Gurobi-versary
    First Question

    Error message when trying the same in gurobi_cl:

    Error: No compression tool available to open .\xxxxxx.mps.7z, please install "7-zip"

    but I have "C:\Program Files\7-Zip\7z.exe" available...

    0
  • Riley Clement
    Gurobi Staff Gurobi Staff

    Hi Felix,

    Can you test whether 7 zip works from the command line (i.e. try `7z -h`)?  You may have it installed but Gurobi needs to be able to know it exists, and I expect this should test whether it will be found.

    If it doesn't work from the command line then I'd suggest adding "C:\Program Files\7-Zip" to your PATH environment variable, then restarting a shell and trying again with gurobi_cl.

    - Riley

    0

Please sign in to leave a comment.