Skip to main content

Gurobi does not work with Juli 172

Answered

Comments

4 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.
  • Simon Bowly
    • 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

    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

Post is closed for comments.