Error to show a JuMP model in v0.7/1.0

julia> m = Model(solver=ClpSolver())
Feasibility problem with:
 * 0 linear constraints
 * 0 variables
Solver is Error showing value of type Model:
ERROR: BoundsError: attempt to access 1-element Array{SubString{String},1} at index [2]
Stacktrace:

Is this intended? Also

julia> @show m
ERROR: BoundsError: attempt to access 1-element Array{SubString{String},1} at index [2]
Stacktrace:

But

julia> print(m)
Min 0
Subject to

It can be an issue when JuMP is used in REPL mode, especially for teaching undergraduate students without much coding experiences. Of course, I can add a semicolon at the end. If this issue has been discussed already, please kindly give me a link.

1 Like

This is fixed in JuMP 0.18.4.

1 Like

“JuMP” => v"0.18.4+"
Julia 0.7

m = Model(solver=IpoptSolver())
ERROR: MethodError: no method matching Model(; solver=IpoptSolver(Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}()))
Closest candidates are:
Model(; caching_mode, bridge_constraints) at /root/.julia/dev/JuMP/src/JuMP.jl:192 got unsupported keyword argument “solver”

It doesn’t look like you’ve updated JuMP correctly (it looks like you’re using JuMP from your dev folder). Either use git in that folder to update manually, or try ] free JuMP, ] up JuMP.