Error with JuMP.model function

Hi,

I’m relatively new to Julia and the JuMP package. The other day I also got the MathOptInterface package in order to export my LP model as a LP-file to be used in LPsolve by a fellow student. However after doing so I ran into an issue with JuMP. When I run the function call

m = Model(Clp.Optimizer)

I get the error:

ERROR: LoadError: MethodError: no method matching Model(::Type{Clp.Optimizer})
Closest candidates are:
Model(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any) at C:\Users.….julia\packages\JuMP\MsUSY\src\JuMP.jl:126
Model(; caching_mode, solver) at C:\Users.….julia\packages\JuMP\MsUSY\src\JuMP.jl:161
Model(::MathOptInterface.AbstractOptimizer, ::Dict{MathOptInterface.ConstraintIndex,AbstractShape}, ::Set{Any}, ::Any, ::Any, ::Dict{Symbol,Any}, ::Int64, ::Dict{Symbol,Any}) at C:\Users.….julia\packages\JuMP\MsUSY\src\JuMP.jl:126

I am now unable to run any of my LP models and I have no idea why I get this error. Any suggestions on how to fix my issues with JuMP?

You have an old version of JuMP.

Try:

] add JuMP@0.21

You should see an error about a package incompatibility. Remove the offending package and try again.

I would encourage you to use a Pkg environment to ensure you have the minimal set of required packages, which minimizes these incompatibilities:
https://julialang.github.io/Pkg.jl/v1.5/environments/

Thank you odow!

] add JuMP@0.21 worked right away.

Previously I tried updating JuMP by using Pkg.update(“JuMP”). As that didn’t work I tried removing it and reinstalling it using Pkg.rm(“JuMP”) and Pkg.add(“JuMP”). Is there a reason this would not give me the newest update?