PowerModels和JuMP版本冲突:需求无法满足

时间:2019-05-16 16:35:52

标签: julia

我是Julia的新手。我想用Julia 1.1.0(通过PowerModels)在Pkg.test()包中测试一些基本的函数调用,所以我根据他们的教程写了几行:

using PowerModels
using Ipopt
using JuMP  # example didn't have this line

run_ac_opf("case5.m", JuMP.with_optimizer(Ipopt.Optimizer))

我将其保存为test1.jl,并在include("test1.jl")上的REPL上运行,并收到以下错误:

julia> include("test1.jl")
ERROR: LoadError: UndefVarError: with_optimizer not defined
Stacktrace:
 [1] include at .\boot.jl:326 [inlined]
 [2] include_relative(::Module, ::String) at .\loading.jl:1038
 [3] include(::Module, ::String) at .\sysimg.jl:29
 [4] include(::String) at .\client.jl:403
 [5] top-level scope at none:0

我不确定导致此错误的原因是,当我尝试同时删除using JuMP和更改为using JuMP.with_optimizer时,仍然得到UndefVarError

更新 我尝试了] rm JuMP] rm PowerModels,并添加了最新的v0.19.1 JuMP(我尝试仅删除v0.18.5 JuMP,但它与我安装的PowerModels软件包冲突。但是,现在当我尝试{{1 }},它给了我以下错误:

] add PowerModels

这是(v1.1) pkg> add PowerModels Resolving package versions... ERROR: Unsatisfiable requirements detected for package JuMP [4076af6c]: JuMP [4076af6c] log: ├─possible versions are: 0.19.1 or uninstalled ├─JuMP [4076af6c] is fixed to version 0.19.1 └─found to have no compatible versions left with 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] 给我的:

] status

似乎我只能使用v0.9.6 PowerModels,但根据其github页面,现在的稳定版本为v0.10.0。有什么建议么?

已解决 JuliaPro是问题所在。我安装了独立的Julia,并且能够同时使用JuMP和PowerModels。

0 个答案:

没有答案