本文介绍了KNITRO.jl无法在Julia 1.0上加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在1.0上添加并构建KNITRO.jl似乎可行,但是在运行using
时出现错误.
Adding and building KNITRO.jl on 1.0 seems to work, but when running using
I get an error.
(v1.0) pkg> add KNITRO
Resolving package versions...
Updating `~/.julia/environments/v1.0/Project.toml`
[no changes]
Updating `~/.julia/environments/v1.0/Manifest.toml`
[no changes]
(v1.0) pkg> build KNITRO
julia> using KNITRO
[ Info: Precompiling KNITRO [67920dd8-b58e-52a8-8622-53c4cffbe346]
ERROR: LoadError: syntax: extra token "KnitroProblem" after end of expression
Stacktrace:
[1] include at ./boot.jl:317 [inlined]
[2] include_relative(::Module, ::String) at ./loading.jl:1038
[3] include(::Module, ::String) at ./sysimg.jl:29
[4] top-level scope at none:2
[5] eval at ./boot.jl:319 [inlined]
[6] eval(::Expr) at ./client.jl:389
[7] top-level scope at ./none:3
in expression starting at
/home/svcarpacomp/.julia/packages/KNITRO/Zou9S/src/KNITRO.jl:37
ERROR: Failed to precompile KNITRO [67920dd8-b58e-52a8-8622-53c4cffbe346] to /home/svcarpacomp/.julia/compiled/v1.0/KNITRO/9GHjY.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:1184
[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
推荐答案
假设您正在 github 并读取您的错误消息,它在KNITRO.jl的第37行失败:
Assuming you're grabbing the copy on github and reading your error message, it fails at line 37 of KNITRO.jl:
type KnitroProblem
type
已过时.它是[mutable] struct
.当前版本显然是用于v0.6
的.如果尝试使用v0.7
,它应该会抛出多个弃用警告.
type
is deprecated. It is [mutable] struct
.The current version is for v0.6
apparently. If you try with v0.7
it should toss several deprecation warnings.
这篇关于KNITRO.jl无法在Julia 1.0上加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!