ERROR: MethodError: no method matching Model

Hello, I’m new in Julia and JuMP and I just tried to install and test JuMP but I got this error (with all solvers that I tested):

julia> Model(Gurobi.Optimizer)
ERROR: MethodError: no method matching Model(::Type{Gurobi.Optimizer})
Closest candidates are:
Model(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any) at …

Hi cotepascal76, welcome to our community.

I would guess that either:

  1. Model was not imported (by using JuMP or import JuMP: Model); but probably this is not the problem.
  2. You are using an older version of JuMP. You can check which version you are using by: import Pkg; Pkg.status().

Thanks for your reply.
I update jump To 0.21 and it works now.