You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Julia Agents.jl预编译失败问题求助

Agents包预编译失败问题

问题描述

运行using Agents时遭遇预编译失败,错误输出如下:

[ Info: Precompiling Agents [46ada45e-f475-11e8-01d0-f70cc89e6671]
WARNING: method definition for #GridSpace#48 at C:\Users\PC\.julia\packages\Agents\h9Ls1\src\spaces\grid.jl:46 declares type variable W but does not use it.
ERROR: LoadError: type DataType has no field size
Stacktrace:
 [1] getproperty(x::Type, f::Symbol)
   @ Base .\Base.jl:32
 [2] top-level scope
   @ C:\Users\PC\.julia\packages\JLD2\qncOK\src\data\number_types.jl:14
 [3] include(mod::Module, _path::String)
   @ Base .\Base.jl:457
 [4] include(x::String)
   @ JLD2 C:\Users\PC\.julia\packages\JLD2\qncOK\src\JLD2.jl:1
 [5] top-level scope
   @ C:\Users\PC\.julia\packages\JLD2\qncOK\src\JLD2.jl:453
 [6] include
   @ .\Base.jl:457 [inlined]
 [7] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::String)
   @ Base .\loading.jl:2049
 [8] top-level scope
   @ stdin:3
in expression starting at C:\Users\PC\.julia\packages\JLD2\qncOK\src\data\number_types.jl:13
in expression starting at C:\Users\PC\.julia\packages\JLD2\qncOK\src\JLD2.jl:1
in expression starting at stdin:3
ERROR: LoadError: Failed to precompile JLD2 [033835bb-8acc-5ee8-8aae-3f567f8a3819] to "C:\\Users\\PC\\.julia\\compiled\\v1.9\\JLD2\\jl_B21B.tmp".
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
    @ Base .\loading.jl:2300
  [3] compilecache
    @ .\loading.jl:2167 [inlined]
  [4] _require(pkg::Base.PkgId, env::String)
    @ Base .\loading.jl:1805
  [5] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:1660
  [6] macro expansion
    @ .\loading.jl:1648 [inlined]
  [7] macro expansion
    @ .\lock.jl:267 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1611
  [9] include(mod::Module, _path::String)
    @ Base .\Base.jl:457
 [10] include(x::String)
    @ Agents.AgentsIO C:\Users\PC\.julia\packages\Agents\h9Ls1\src\submodules\io\AgentsIO.jl:9
 [11] top-level scope
    @ C:\Users\PC\.julia\packages\Agents\h9Ls1\src\submodules\io\AgentsIO.jl:13
 [12] include(mod::Module, _path::String)
    @ Base .\Base.jl:457
 [13] include(x::String)
    @ Agents C:\Users\PC\.julia\packages\Agents\h9Ls1\src\Agents.jl:1
 [14] top-level scope
    @ C:\Users\PC\.julia\packages\Agents\h9Ls1\src\Agents.jl:38
 [15] include
    @ .\Base.jl:457 [inlined]
 [16] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::String)
    @ Base .\loading.jl:2049
 [17] top-level scope
    @ stdin:3
in expression starting at C:\Users\PC\.julia\packages\Agents\h9Ls1\src\submodules\io\jld2_integration.jl:2
in expression starting at C:\Users\PC\.julia\packages\Agents\h9Ls1\src\submodules\io\AgentsIO.jl:3
in expression starting at C:\Users\PC\.julia\packages\Agents\h9Ls1\src\Agents.jl:1
in expression starting at stdin:3
ERROR: Failed to precompile Agents [46ada45e-f475-11e8-01d0-f70cc89e6671] to "C:\\Users\\PC\\.julia\\compiled\\v1.9\\Agents\\jl_A1CF.tmp".
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
    @ Base .\loading.jl:2300
  [3] compilecache
    @ .\loading.jl:2167 [inlined]
  [4] _require(pkg::Base.PkgId, env::String)
    @ Base .\loading.jl:1805
  [5] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:1660
  [6] macro expansion
    @ .\loading.jl:1648 [inlined]
  [7] macro expansion
    @ .\lock.jl:267 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1611
  [9] eval
    @ .\boot.jl:370 [inlined]
 [10] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
    @ Base .\loading.jl:1903
 [11] invokelatest(::Any, ::Any, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Base .\essentials.jl:819
 [12] invokelatest(::Any, ::Any, ::Vararg{Any})
    @ Base .\essentials.jl:816
 [13] inlineeval(m::Module, code::String, code_line::Int64, code_column::Int64, file::String; softscope::Bool)
    @ VSCodeServer c:\Users\PC\.vscode\extensions\julialang.language-julia-1.51.2\scripts\packages\VSCodeServer\src\eval.jl:261
 [14] (::VSCodeServer.var"#67#72"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
    @ VSCodeServer c:\Users\PC\.vscode\extensions\julialang.language-julia-1.51.2\scripts\packages\VSCodeServer\src\eval.jl:181
 [15] withpath(f::VSCodeServer.var"#67#72"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams}, path::String)
    @ VSCodeServer c:\Users\PC\.vscode\extensions\julialang.language-julia-1.51.2\scripts\packages\VSCodeServer\src\repl.jl:274
 [16] (::VSCodeServer.var"#66#71"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
    @ VSCodeServer c:\Users\PC\.vscode\extensions\julialang.language-julia-1.51.2\scripts\packages\VSCodeServer\src\eval.jl:179
 [17] hideprompt(f::VSCodeServer.var"#66#71"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})
    @ VSCodeServer c:\Users\PC\.vscode\extensions\julialang.language-julia-1.51.2\scripts\packages\VSCodeServer\src\repl.jl:38
 [18] (::VSCodeServer.var"#65#70"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
    @ VSCodeServer c:\Users\PC\.vscode\extensions\julialang.language-julia-1.51.2\scripts\packages\VSCodeServer\src\eval.jl:150
 [19] with_logstate(f::Function, logstate::Any)
    @ Base.CoreLogging .\logging.jl:514
 [20] with_logger
    @ .\logging.jl:626 [inlined]
 [21] (::VSCodeServer.var"#64#69"{VSCodeServer.ReplRunCodeRequestParams})()
    @ VSCodeServer c:\Users\PC\.vscode\extensions\julialang.language-julia-1.51.2\scripts\packages\VSCodeServer\src\eval.jl:253
 [22] #invokelatest#2
    @ .\essentials.jl:819 [inlined]
 [23] invokelatest(::Any)
    @ Base .\essentials.jl:816
 [24] macro expansion
    @ c:\Users\PC\.vscode\extensions\julialang.language-julia-1.51.2\scripts\packages\VSCodeServer\src\eval.jl:34 [inlined]
 [25] (::VSCodeServer.var"#62#63")()
    @ VSCodeServer .\task.jl:514

已尝试的解决方法

  • 更新所有包,无效
  • 重装Julia,仅首次运行using Agents成功,再次运行依旧失败

内容的提问来源于stack exchange,提问作者Han

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.11 04:37:02