Errors using JuMP with Ipopt or HiGHS: UndefVarError: libipopt not defined and UndefVarError: libhighs not defined

I have Ipopt, OSQPand HiGHS installed. In Jupiter, when running the following script,

n = size(Sigma,1) # Sigma is a 30x30 covariance matrix
m = Model(Ipopt.Optimizer)
@variable(m, w[1:n])
@objective(m, Min, w' * Sigma * w)
@constraint(m, sum(w) == 1)
@constraint(m, w .>= 0)
optimize!(m)
value.(w)

I get the following error:

UndefVarError: libipopt not defined

Stacktrace: [1] createProblem(n::Int64, x_L::Vector{Float64}, x_U::Vector{Float64}, m::Int64, g_L::Vector{Float64}, g_U::Vector{Float64}, nele_jac::Int64, nele_hess::Int64, eval_f::Ipopt.var"#eval_f_cb#44"{Ipopt.Optimizer}, eval_g::Ipopt.var"#eval_g_cb#46"{Ipopt.Optimizer}, eval_grad_f::Ipopt.var"#eval_grad_f_cb#45"{Ipopt.Optimizer}, eval_jac_g::Ipopt.var"#eval_jac_g_cb#47"{Ipopt.Optimizer, Vector{Tuple{Int64, Int64}}}, eval_h::Ipopt.var"#eval_h_cb#48"{Ipopt.Optimizer, Vector{Tuple{Int64, Int64}}}) @ Ipopt ~/.julia/packages/Ipopt/vtrOr/src/Ipopt.jl:320 [2] optimize!(model::Ipopt.Optimizer) @ Ipopt ~/.julia/packages/Ipopt/vtrOr/src/MOI_wrapper.jl:1616 [3] optimize!(b::MathOptInterface.Bridges.LazyBridgeOptimizer{Ipopt.Optimizer}) @ MathOptInterface.Bridges ~/.julia/packages/MathOptInterface/YDdD3/src/Bridges/bridge_optimizer.jl:319 [4] optimize!(m::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.GenericModel{Float64, MathOptInterface.Utilities.ModelFunctionConstraints{Float64}}}}) @ MathOptInterface.Utilities ~/.julia/packages/MathOptInterface/YDdD3/src/Utilities/cachingoptimizer.jl:252 [5] optimize!(model::Model, optimizer_factory::Nothing; bridge_constraints::Bool, ignore_optimize_hook::Bool, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}) @ JuMP ~/.julia/packages/JuMP/e0Uc2/src/optimizer_interface.jl:130 [6] optimize! (repeats 2 times) @ ~/.julia/packages/JuMP/e0Uc2/src/optimizer_interface.jl:106 [inlined] [7] top-level scope @ In[50]:7 [8] eval @ ./boot.jl:373 [inlined] [9] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String) @ Base ./loading.jl:1196

Replacing m = Model(Ipopt.Optimizer) with m = Model(HiGHS.Optimizer) one gets the similar error: UndefVarError: libhighs not defined. However m = Model(OSQP.Optimizer) runs and computes the optimal weights w.

My list of packages is the following:
[9961bab8] Cbc v0.8.1
[a93c6f00] DataFrames v1.3.2
[31c24e10] Distributions v0.23.8
[87dc4568] HiGHS v0.2.3
[b6b21f68] Ipopt v0.7.0
[4076af6c] JuMP v0.21.4
[76087f3c] NLopt v0.6.3
[ab2f91bb] OSQP v0.6.1
[429524aa] Optim v1.6.2
[f3b207a7] StatsPlots v0.14.30

I am wondering if I am doing something wrong… Thanks in advance!

Is this on an M1 Mac? Please update to the latest versions of each package.

x-ref: https://github.com/jump-dev/HiGHS.jl/issues/96

Yes, it is on an M1 Mac. Indeed, updating solved the problem. Thank you!

HI,
I am facing the same issue with Ipopt and Highs, updating the packages is also not resolving the issue.
I am wondering if I am doing something wrong… Thanks in advance!
Thanks
Aakriti

Hi @Aakriti_Rohatgi, please start a new post, and provide the output of versioninfo() and import Pkg; Pkg.status().

If I have to guess, you probably have a large number of packages in the global environment. Try following the example here to create a new environment: