How to properly add the package "ConditionalJuMP" in Julia language?

128 views Asked by At

The command "Pkg.add("ConditionalJuMP)" works.

However when, I am trying the command (using ConditionalJuMP), I am getting this error. Anyone can propose me something?

enter image description here

2

There are 2 answers

0
Oscar Dowson On

ConditionalJuMP doesn't support the latest version of JuMP. You will need to install an old version via: ] add [email protected].

I would encourage you to instead use the latest version of JuMP, and its native support for indicator constraints: https://jump.dev/JuMP.jl/stable/constraints/#Indicator-constraints-1

2
Daniel Schmid On

Have you taken a look at ConditionalJuMP's GitHub repo? The latest release (0.1.0) has been for Julia 1.0, and thus seems pretty outdated by now with not much work going on...

Diff master w.r.t. 0.1.0 release: here

Telling from your screenshot, Julia tried to precompile ConditionalJuMP into ./julia/compiled/v1.5. So I guess you are using Julia 1.5, right?

First thing I'd do is trying to go back to Julia 1.0 and see whether ConditionalJuMP would be working with it (or if that woudlnd't suffice on its own by actively chossing earlier JuMP versions as explicit packages within your project), since overall it seems like GenericRangeConstraint is missing/not found - which was part of earlier JuMP versions, but probably isn't anymore (not a JuMP expert here, though).