Skip to main content

Gurobi does not work with Juli 172

Answered

Comments

3 comments

  • Simon Bowly
    Gurobi Staff Gurobi Staff

    Hi Edmond,

    Can you first make sure you have the latest version of Gurobi.jl installed, and then rebuild the package? The latest Gurobi.jl version right now is 0.11.0, so the sequence of commands in the Julia package manager should be:

    ] update
    ] add Gurobi@0.11.0
    ] build Gurobi

    Type ] to enter the Pkg mode, then type the rest of each line. Also, please ensure the GUROBI_HOME environment variable is set correctly to point to your Gurobi installation.

    Best regards,
    Simon

    0
  • edmond baranes
    Gurobi-versary
    First Comment
    First Question

    Thank you but now ...the message is:

       Resolving package versions...
      No Changes to `C:\Users\33688\.julia\environments\v1.7\Project.toml`
      No Changes to `C:\Users\33688\.julia\environments\v1.7\Manifest.toml`
    
     
    UndefVarError: with_optimizer not defined
    
    Stacktrace:
     [1] top-level scope
       @ In[9]:7
     [2] eval
       @ .\boot.jl:373 [inlined]
     [3] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
       @ Base .\loading.jl:1196
    

     

    0
  • Simon Bowly
    Gurobi Staff Gurobi Staff

    Hi Edmond,

    It looks like you are using the older JuMP API (which uses with_optimizer).  You'll need to update your code to use the following method to build a model:

    using JuMP
    using Gurobi

    model = Model(Gurobi.Optimizer)

    as outlined in the JuMP example codes.

    0

Please sign in to leave a comment.