JuMP stopped working

Hello, I reinstalled Julia (v1.4.1), and now I am no longer able to use JuMP. Please find my code and error log below.

Pkg.add("JuMP") should install the recent version of JuMP but when I check the status it is actually JuMP v0.18.6. I have tried Pkg.update("JuMP") and Pkg.build("JuMP") but still the version remains the same.
CLP solver version is Clp v0.8.0

I am not sure what is causing this error as yesterday everything was working fine post reinstallation, so something must have gone wrong after restarting the computer. Any help will be appreciated.

using JuMP
using Clp
model = Model(Clp.Optimizer)
ERROR: MethodError: no method matching Model(::Type{Clp.Optimizer})
Closest candidates are:
  Model(::Any, ::Symbol, ::Any, ::Any, ::Any, ::Any, ::Any, ::Int64, ::Array{String,1}, ::Array{String,1}, ::Array{Float64,1}, ::Array{Float64,1}, ::Array{Symbol,1}, ::Array{T,1} where T, ::Array{Tuple{Symbol,Any},1}, ::Any, ::Any, ::Array{Float64,1}, ::Array{Float64,1}, ::Array{Float64,1}, ::Array{Float64,1}, ::Array{Array{Int64,1},1}, ::Array{Array{Tuple{Int64,Int64},1},1}, ::Any, ::MathProgBase.SolverInterface.AbstractMathProgSolver, ::Bool, ::Any, ::Any, ::Any, ::Array{T,1} where T, ::JuMP.IndexedVector{Float64}, ::Any, ::Bool, ::Dict{Symbol,Any}, ::IdDict, ::Int64, ::Int64, ::Dict{Symbol,Any}) at C:\Users\.julia\packages\JuMP\I7whV\src\JuMP.jl:87
  Model(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any) at C:\Users\.julia\packages\JuMP\I7whV\src\JuMP.jl:87
  Model(; solver, simplify_nonlinear_expressions) at C:\Users\.julia\packages\JuMP\I7whV\src\JuMP.jl:168
Stacktrace:
 [1] top-level scope at REPL[14]:1

You can try ] update to bring you up to the latest versions of all packages, including JuMP.

I have tried ] update but it does not seem to update the latest version for JuMP

Most likely you have some other packages installed that require JuMP v0.18 and are not compatible with v0.19. I forget how exactly to see what is holding you back, but you can try clearing out your installed packages and then start by installing JuMP.

3 Likes

Thank you. I just managed to fix it after trying ] add JuMP@v0.21.1 and you are right it was one of the packages which was holding up everything. After removing the solver Pajarito, I can now update JuMP.

I am not sure why installing a particular solver would change the JuMP version- if it is not compatible with a recent version of JuMP then it should just throw an error.

ERROR: Unsatisfiable requirements detected for package Pajarito [2f354839]:
 Pajarito [2f354839] log
1 Like

Great! It depends on the order of operations. If you install JuMP first and then Pajarito you will likely get an error that Pajarito is not compatible. But if you install Pajarito first and then JuMP it will install the most recent compatible version of JuMP, which is v0.18.

1 Like