I’m using JuMP and had several models that were running fine. Now, whenever I try to initialize a model (for example Model(Gurobi.Optimizer)
), I get the error:
MethodError: no method matching Model(::Type{Gurobi.Optimizer})
Closest candidates are:
Model(::Any, !Matched::Symbol, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Int64, !Matched::Array{String,1}, !Matched::Array{String,1}, !Matched::Array{Float64,1}, !Matched::Array{Float64,1}, !Matched::Array{Symbol,1}, !Matched::Array{T,1} where T, !Matched::Array{Tuple{Symbol,Any},1}, !Matched::Any, !Matched::Any, !Matched::Array{Float64,1}, !Matched::Array{Float64,1}, !Matched::Array{Float64,1}, !Matched::Array{Float64,1}, !Matched::Array{Array{Int64,1},1}, !Matched::Array{Array{Tuple{Int64,Int64},1},1}, !Matched::Any, !Matched::MathProgBase.SolverInterface.AbstractMathProgSolver, !Matched::Bool, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Array{T,1} where T, !Matched::JuMP.IndexedVector{Float64}, !Matched::Any, !Matched::Bool, !Matched::Dict{Symbol,Any}, !Matched::IdDict, !Matched::Int64, !Matched::Int64, !Matched::Dict{Symbol,Any}) at /Users/Hassan/.julia/packages/JuMP/I7whV/src/JuMP.jl:87
Model(::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any) at /Users/Hassan/.julia/packages/JuMP/I7whV/src/JuMP.jl:87
Model(; solver, simplify_nonlinear_expressions) at /Users/Hassan/.julia/packages/JuMP/I7whV/src/JuMP.jl:168
top-level scope at haha.jl:15
Note that I had initialized both JuMP & Gurobi (e.g. using JuMP, Ipopt, Gurobi, LinearAlgebra
) prior to creating the model. I have tried restarting my laptop and updating the packages I’m using, but the error is still there.
Any idea what went wrong? It was working fine… until it wasn’t.