添加软件包时如何使用Julia规避预编译错误

时间:2018-08-14 20:20:57

标签: julia julia-jump

我正在尝试通过Julia编程使用三个不同的程序包(使用Atom IDE,以实现其价值)。

我对朱莉娅很陌生,所以请原谅任何无知!这就是我所拥有的:

Pkg.add("JuMP")
Pkg.add("DataFrames")
Pkg.add("GLPKMathProgInterface")

这些成功运行。

那我有:

using DataFrames
using GLPKMathProgInterface
using JuMP

“ using DataFrames”行成功执行,但此后出现预编译/安装错误:

ERROR: LoadError: GLPK not properly installed. Please run Pkg.build("GLPK")
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] top-level scope at /Users/connordaly/.julia/packages/GLPK/thMVo/src/GLPK.jl:199
 [3] include at ./boot.jl:317 [inlined]
 [4] include_relative(::Module, ::String) at ./loading.jl:1038
 [5] include(::Module, ::String) at ./sysimg.jl:29
 [6] top-level scope at none:2
 [7] eval at ./boot.jl:319 [inlined]
 [8] eval(::Expr) at ./client.jl:399
 [9] top-level scope at ./none:3
in expression starting at /Users/connordaly/.julia/packages/GLPK/thMVo/src/GLPK.jl:196
ERROR: LoadError: LoadError: Failed to precompile GLPK [60bf3e95-4087-53dc-ae20-288a0d20c6a6] to /Users/connordaly/.julia/compiled/v0.7/GLPK/r6CoY.ji.
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] macro expansion at ./logging.jl:313 [inlined]
 [3] compilecache(::Base.PkgId, ::String) at ./loading.jl:1185
 [4] _require(::Base.PkgId) at ./logging.jl:311
 [5] require(::Base.PkgId) at ./loading.jl:852
 [6] macro expansion at ./logging.jl:311 [inlined]
 [7] require(::Module, ::Symbol) at ./loading.jl:834
 [8] include at ./boot.jl:317 [inlined]
 [9] include_relative(::Module, ::String) at ./loading.jl:1038
 [10] include at ./sysimg.jl:29 [inlined]
 [11] include(::String) at /Users/connordaly/.julia/packages/GLPKMathProgInterface/Ijibf/src/GLPKMathProgInterface.jl:2
 [12] top-level scope at none:0
 [13] include at ./boot.jl:317 [inlined]
 [14] include_relative(::Module, ::String) at ./loading.jl:1038
 [15] include(::Module, ::String) at ./sysimg.jl:29
 [16] top-level scope at none:2
 [17] eval at ./boot.jl:319 [inlined]
 [18] eval(::Expr) at ./client.jl:399
 [19] top-level scope at ./none:3
in expression starting at /Users/connordaly/.julia/packages/GLPKMathProgInterface/Ijibf/src/GLPKInterfaceBase.jl:6
in expression starting at /Users/connordaly/.julia/packages/GLPKMathProgInterface/Ijibf/src/GLPKMathProgInterface.jl:10
ERROR: Failed to precompile GLPKMathProgInterface [3c7084bd-78ad-589a-b5bb-dbd673274bea] to /Users/connordaly/.julia/compiled/v0.7/GLPKMathProgInterface/Y5bTM.ji.
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] macro expansion at ./logging.jl:313 [inlined]
 [3] compilecache(::Base.PkgId, ::String) at ./loading.jl:1185
 [4] macro expansion at ./logging.jl:311 [inlined]
 [5] _require(::Base.PkgId) at ./loading.jl:941
 [6] require(::Base.PkgId) at ./loading.jl:852
 [7] macro expansion at ./logging.jl:311 [inlined]
 [8] require(::Module, ::Symbol) at ./loading.jl:834

我已经尝试了很多方法来使此程序包正常工作,但到目前为止还没有运气。有人可以帮我吗?预先感谢!

1 个答案:

答案 0 :(得分:1)

作为Julia的新用户,我认为您正在尝试使用此版本1.0。此公告与https://discourse.julialang.org/t/psa-use-julia-0-7-if-you-are-upgrading/13321相关。

Julia 0.7具有与1.0相同的功能,但仍具有兼容性过时警告,已在1.0中删除。

暂时尝试一下Julia 0.7。如果您再次遇到该特定错误,则可能还添加了Pkg.build("GLPK")