Error while adding a package

I’m new to Julia, and I’ve installed Atom and a couple of packages already. However when I’ve tried to add PowerModels package, I’ve recieved an error message:

ERROR: Unsatisfiable requirements detected for package PowerModels [c36e90e8]:
PowerModels [c36e90e8] log:
├─possible versions are: [0.1.0, 0.2.0-0.2.3, 0.3.0-0.3.4, 0.4.0, 0.5.0-0.5.1, 0.6.0-0.6.1, 0.7.0-0.7.2, 0.8.0-0.8.8, 0.9.0-0.9.6] or uninstalled
├─restricted to versions * by an explicit requirement, leaving only versions [0.1.0, 0.2.0-0.2.3, 0.3.0-0.3.4, 0.4.0, 0.5.0-0.5.1, 0.6.0-0.6.1, 0.7.0-0.7.2, 0.8.0-0.8.8, 0.9.0-0.9.6]
└─restricted by compatibility requirements with JuMP [4076af6c] to versions: uninstalled — no versions left
  └─JuMP [4076af6c] log:
    ├─possible versions are: [0.1.1-0.1.2, 0.2.0, 0.3.0-0.3.2, 0.4.0-0.4.1, 0.5.0-0.5.8, 0.6.0-0.6.3, 0.7.0-0.7.4, 0.8.0, 0.9.0-0.9.3, 0.10.0-0.10.3, 0.11.0-0.11.3, 0.12.0-0.12.2, 0.13.0-0.13.2, 0.14.0-0.14.2, 0.15.0-0.15.1, 0.16.0-0.16.2, 0.17.0-0.17.1, 0.18.0-0.18.5, 0.19.0] or uninstalled
    └─restricted to versions 0.19.0 by an explicit requirement, leaving only versions 0.19.0

What is the reason? The JuMP version that I’ve installed is 0.19.0 according to the Pkg.status(“JuMP”).
The Julia version that I have is 1.1.0
Thank you!

Try add JuMP PowerModels to allow JuMP to downgrade.

Thank you for the reply. What is the exact command? I’ve tried to reinstall Julia Pro, but now I get this error:

ERROR: GitError(Code:EMERGECONFLICT, Class:Checkout, 176 conflicts prevent checkout)
Stacktrace:
 [1] macro expansion at C:\Users\julia\AppData\Local\Julia-1.1.0\share\julia\stdlib\v1.1\LibGit2\src\error.jl:101 [inlined]
 [2] #checkout_tree#46(::LibGit2.CheckoutOptions, ::Function, ::LibGit2.GitRepo, ::LibGit2.GitCommit) at C:\Users\julia\AppData\Local\Julia-1.1.0\share\julia\stdlib\v1.1\LibGit2\src\repository.jl:358
 [3] checkout_tree at C:\Users\julia\AppData\Local\Julia-1.1.0\share\julia\stdlib\v1.1\LibGit2\src\repository.jl:356 [inlined]
 [4] ffmerge!(::LibGit2.GitRepo, ::LibGit2.GitAnnotated) at C:\Users\julia\AppData\Local\Julia-1.1.0\share\julia\stdlib\v1.1\LibGit2\src\merge.jl:107
 [5] #merge!#89(::LibGit2.MergeOptions, ::LibGit2.CheckoutOptions, ::Function, ::LibGit2.GitRepo, ::Array{LibGit2.GitAnnotated,1}, ::Bool) at C:\Users\julia\AppData\Local\Julia-1.1.0\share\julia\stdlib\v1.1\LibGit2\src\merge.jl:234
 [6] #merge! at .\none:0 [inlined]
 [7] #merge!#140(::String, ::String, ::Bool, ::LibGit2.MergeOptions, ::LibGit2.CheckoutOptions, ::Function, ::LibGit2.GitRepo) at C:\Users\julia\AppData\Local\Julia-1.1.0\share\julia\stdlib\v1.1\LibGit2\src\LibGit2.jl:784
 [8] #merge! at .\none:0 [inlined]
 [9] update_registries(::Pkg.Types.Context, ::Array{Pkg.Types.RegistrySpec,1}) at C:\Users\julia\AppData\Local\Julia-1.1.0\share\julia\stdlib\v1.1\Pkg\src\Types.jl:1254
 [10] update_registries at C:\Users\julia\AppData\Local\Julia-1.1.0\share\julia\stdlib\v1.1\Pkg\src\Types.jl:1219 [inlined]
 [11] #handle_repos_add!#61(::Bool, ::Nothing, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at C:\Users\julia\AppData\Local\Julia-1.1.0\share\julia\stdlib\v1.1\Pkg\src\Types.jl:719
 [12] #handle_repos_add! at C:\Users\julia\AppData\Local\Julia-1.1.0\share\julia\stdlib\v1.1\Pkg\src\API.jl:0 [inlined]
 [13] #add_or_develop#15(::Symbol, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at C:\Users\julia\AppData\Local\Julia-1.1.0\share\julia\stdlib\v1.1\Pkg\src\API.jl:42
 [14] #add_or_develop at .\none:0 [inlined]
 [15] #add_or_develop#14 at C:\Users\julia\AppData\Local\Julia-1.1.0\share\julia\stdlib\v1.1\Pkg\src\API.jl:31 [inlined]
 [16] #add_or_develop at .\none:0 [inlined]
 [17] #add_or_develop#13 at C:\Users\julia\AppData\Local\Julia-1.1.0\share\julia\stdlib\v1.1\Pkg\src\API.jl:29 [inlined]
 [18] #add_or_develop at .\none:0 [inlined]
 [19] #add_or_develop#12(::Base.Iterators.Pairs{Symbol,Symbol,Tuple{Symbol},NamedTuple{(:mode,),Tuple{Symbol}}}, ::Function, ::String) at C:\Users\julia\AppData\Local\Julia-1.1.0\share\julia\stdlib\v1.1\Pkg\src\API.jl:28
 [20] #add_or_develop at .\none:0 [inlined]
 [21] #add#20 at C:\Users\julia\AppData\Local\Julia-1.1.0\share\julia\stdlib\v1.1\Pkg\src\API.jl:59 [inlined]
 [22] add(::String) at C:\Users\julia\AppData\Local\Julia-1.1.0\share\julia\stdlib\v1.1\Pkg\src\API.jl:59
 [23] top-level scope at none:0

Ok, I’ve solved the problem:
Deleted JuMP, and reinstalled PowerModels first, and after that installed compatible JuMP version.

Hey, I have the same problem. I actually started with ] add PowerModels and then ] add JuMP which worked fine (it installed JuMP 0.18.5), until I tried PowerModels’ tutorial where they used JuMP.with_optimizer() which apparently is only available in JuMP 0.19.0 or later. So I deleted both and now I have the newest JuMP (0.19.1) but I cannot install PowerModels anymore, even with ] add PowerModels@0.9.6 which according to the error message would not cause a conflict with 0.19.1 JuMP. Could you please check your versions of JuMP and PowerModels with ] status? Thanks so much.

I would just use a clean environment when following a tutorial (it is really an ideal use case):

(v1.0) pkg> activate /tmp/CleanEnv
[ Info: activating new environment at /tmp/CleanEnv.

(CleanEnv) pkg> add JuMP PowerModels
 Resolving package versions...
  Updating `/tmp/CleanEnv/Project.toml`
  [4076af6c] + JuMP v0.19.1
  [c36e90e8] + PowerModels v0.10.0
...

Now you should be able to run import JuMP and import PowerModels just fine.

2 Likes

I got plenty of there package install errors.
This clean env “trick” should really be shared/spread in (lots of) packages docs !
Thanks for sharing

Sorry for the delay. Actually what I did was similar to your approach: first adding the PowerModels, and then JuMP. But in that case the JuMP version was 0.18.5.

Could not install the PowerModels after the JuMP (since it tells me that 0.19.1 version of JuMP is not working with 0.9.6 version of PowerModels).

Hi, have you got it working? Because for my thing, I needed with_optimizer and 0.18.5 JuMP doesn’t work with that. So if you need it as well, the way I solved it was to uninstall JuliaPro (that’s the one I installed and was most likely causing the problem) and reinstall a standalone Julia. Then add the packages you need and everything is up to date and the power flow stuff in PowerModels work fine.

Only in a way mentioned above. Thank you for the solution!

1 Like