gpt4 book ai didi

julia - 添加包时如何使用 Julia 避免预编译错误

转载 作者:行者123 更新时间:2023-12-05 06:31:18 25 4
gpt4 key购买 nike

我尝试在 Julia 编程中使用三个不同的包(使用 Atom IDE,物有所值)。

我是 Julia 的新手,请原谅我的无知!这是我得到的:

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

我已经尝试了很多方法来让这个包工作,但到目前为止运气不好。谁能帮帮我?提前致谢!

最佳答案

作为 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")

关于julia - 添加包时如何使用 Julia 避免预编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51849195/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com