无法将 DifferentialEquation.jl 添加到 Julia 1.7.0

Posted

技术标签:

【中文标题】无法将 DifferentialEquation.jl 添加到 Julia 1.7.0【英文标题】:Can't add DifferentialEquation.jl to Julia 1.7.0 【发布时间】:2022-01-22 23:13:04 【问题描述】:

我最近从 Julia 1.6.3 升级到 1.7.0。我将 ManifestProject.toml 文件复制到新的 environments 文件夹中,并根据说明将 Manifest 文件更新为较新的版本。一切正常。但是,当我后来尝试添加 DifferentialEquations.jl 时,我收到了这个错误:

(@v1.7) pkg> precompile
Precompiling project...
✗ DiffEqNoiseProcess
✗ DiffEqFinancial
✗ StochasticDiffEq
✗ MultiScaleArrays
✗ DifferentialEquations
        
0 dependencies successfully precompiled in 30 seconds (252 already precompiled)
ERROR: The following 2 direct dependencies failed to precompile:
DiffEqNoiseProcess [77a26b50-5914-5dd7-bc55-306e6241c503] 
Failed to precompile DiffEqNoiseProcess [77a26b50-5914-5dd7-bc55-306e6241c503] to C:\Users\*user*\.julia\compiled\v1.7\DiffEqNoiseProcess\jl_F949.tmp.

WARNING: Method definition Type##kw(Any, TypeBase.MPFR.BigFloat, Base.Irrational:fourinvπ) in module StatsFuns at irrationals.jl:182 overwritten in module IrrationalConstants on the same line (check for duplicate calls to `include`).
** incremental compilation may be fatally broken for this module **

WARNING: Method definition Type##kw(Any, TypeBase.MPFR.BigFloat, Base.Irrational:twoinvπ) in module StatsFuns at irrationals.jl:182 overwritten in module IrrationalConstants on the same line (check for duplicate calls to `include`).
** incremental compilation may be fatally broken for this module **

...

它会继续发出类似的警告一段时间,最后我明白了:

ERROR: LoadError: UndefVarError: SciMLBase not defined
Stacktrace:
[1] top-level scope
@ C:\Users\manfr\.julia\packages\DiffEqNoiseProcess\9NzQP\src\solve.jl:1
[2] include(mod::Module, _path::String)
@ Base .\Base.jl:418
[3] include(x::String)
@ DiffEqNoiseProcess C:\Users\manfr\.julia\packages\DiffEqNoiseProcess\9NzQP\src\DiffEqNoiseProcess.jl:1
[4] top-level scope
@ C:\Users\manfr\.julia\packages\DiffEqNoiseProcess\9NzQP\src\DiffEqNoiseProcess.jl:23
[5] include
@ .\Base.jl:418 [inlined]
[6] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::VectorString,
dl_load_path::VectorString, load_path::VectorString,
concrete_deps::VectorPairBase.PkgId, UInt64, source::String)
@ Base .\loading.jl:1318
[7] top-level scope
@ none:1
[8] eval
@ .\boot.jl:373 [inlined]
[9] eval(x::Expr)
@ Base.MainInclude .\client.jl:453
[10] top-level scope
@ none:1
in expression starting at
C:\Users\manfr\.julia\packages\DiffEqNoiseProcess\9NzQP\src\solve.jl:1
in expression starting at C:\Users\manfr\.julia\packages\DiffEqNoiseProcess\9NzQP\src\DiffEqNoiseProcess.jl:1
ERROR: LoadError: Failed to precompile DiffEqNoiseProcess [77a26b50-5914-5dd7-bc55-
306e6241c503] to C:\Users\manfr\.julia\compiled\v1.7\DiffEqNoiseProcess\jl_5956.tmp.
Stacktrace:
[1] error(s::String)
@ Base .\error.jl:33
[2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO,
ignore_loaded_modules::Bool)
@ Base .\loading.jl:1466
[3] compilecache(pkg::Base.PkgId, path::String)
@ Base .\loading.jl:1410
[4] _require(pkg::Base.PkgId)
@ Base .\loading.jl:1120
[5] require(uuidkey::Base.PkgId)
@ Base .\loading.jl:1013
[6] require(into::Module, mod::Symbol)
@ Base .\loading.jl:997
[7] include 
@ .\Base.jl:418 [inlined]
[8] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::VectorString,
dl_load_path::VectorString, load_path::VectorString,
concrete_deps::VectorPairBase.PkgId, UInt64, source::Nothing)
@ Base .\loading.jl:1318
[9] top-level scope
@ none:1
[10] eval
@ .\boot.jl:373 [inlined]
[11] eval(x::Expr)
@ Base.MainInclude .\client.jl:453
[12] top-level scope
@ none:1
in expression starting at
C:\Users\manfr\.julia\packages\DifferentialEquations\el96s\src\DifferentialEquations.jl:1   

我尝试构建、预编译、删除包文件夹并再次添加它,但似乎没有任何效果。我还尝试将包添加到我的 Julia 1.6.3 安装中,并且效果很好。有谁知道可能是什么问题?

【问题讨论】:

【参考方案1】:

清单是特定于版本的(因为包版本可以是特定于 Julia 版本的)。在没有清单的情况下重新解析您的包。

【讨论】:

很多问题是 Julia 1.7 引入了一种新的清单格式,它更好,但与旧的不兼容。 谢谢,我用原版替换了它。

以上是关于无法将 DifferentialEquation.jl 添加到 Julia 1.7.0的主要内容,如果未能解决你的问题,请参考以下文章

为啥我无法正确获取图像数据或无法将数据发送到服务器?

无法将 createdAt 和 updatedAt 保存为日期时间值,也无法将后端保存为前端

C# 无法将类型为“System.Byte[]”的对象强制转换为类型“System.Data.DataTable

无法将类型为“System.Collections.Generic.List`1[EPMS.Domain.SingleItem]”的对象强制转换为类型“EPMS

无法将 .json 文件从 CSV 下载到 JSON 转换并且无法将 JSON 转换为 CSV

无法将 ReactiveUI 添加到 NUnit 测试项目