Skip to content

[ITensors] [BUG] Failed to precompile: "KeyError: key "TypeParameterAccessors" not found" #1618

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JaydevSR opened this issue Feb 17, 2025 · 5 comments
Labels
bug Something isn't working ITensors Issues or pull requests related to the `ITensors` package.

Comments

@JaydevSR
Copy link

The package fails to precompile giving the following error:

pkg> precompile
Precompiling project...
  ✗ ITensors
  ✗ ITensors  ITensorsVectorInterfaceExt
  0 dependencies successfully precompiled in 7 seconds. 119 already precompiled.

ERROR: The following 2 direct dependencies failed to precompile:

ITensors

Failed to precompile ITensors [9136182c-28ba-11e9-034c-db9fb085ebd5] to "C:\\Users\\u0174972\\.julia\\compiled\\v1.11\\ITensors\\jl_E7E2.tmp".
ERROR: LoadError: KeyError: key "TypeParameterAccessors" not found
Stacktrace:
  [1] getindex
    @ .\dict.jl:477 [inlined]
  [2] _insert_extension_triggers(parent::Base.PkgId, extensions::Dict{String, Any}, weakdeps::Dict{String, Any})
    @ Base .\loading.jl:1471
  [3] insert_extension_triggers(env::String, pkg::Base.PkgId)
    @ Base .\loading.jl:1434
  [4] insert_extension_triggers
    @ .\loading.jl:1390 [inlined]
  [5] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:2309
  [6] #invoke_in_world#3
    @ .\essentials.jl:1088 [inlined]
  [7] invoke_in_world
    @ .\essentials.jl:1085 [inlined]
  [8] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:2287
  [9] macro expansion
    @ .\loading.jl:2226 [inlined]
 [10] macro expansion
    @ .\lock.jl:273 [inlined]
 [11] __require(into::Module, mod::Symbol)
    @ Base .\loading.jl:2183
 [12] #invoke_in_world#3
    @ .\essentials.jl:1088 [inlined]
 [13] invoke_in_world
    @ .\essentials.jl:1085 [inlined]
 [14] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:2176
 [15] include(mod::Module, _path::String)
    @ Base .\Base.jl:557
 [16] include(x::String)
    @ ITensors C:\Users\u0174972\.julia\packages\ITensors\Zs2nC\src\ITensors.jl:51
 [17] top-level scope
    @ C:\Users\u0174972\.julia\packages\ITensors\Zs2nC\src\ITensors.jl:52
 [18] include
    @ .\Base.jl:557 [inlined]
 [19] 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::Nothing)
    @ Base .\loading.jl:2806
 [20] top-level scope
    @ stdin:4
in expression starting at C:\Users\u0174972\.julia\packages\ITensors\Zs2nC\src\usings.jl:14
in expression starting at C:\Users\u0174972\.julia\packages\ITensors\Zs2nC\src\ITensors.jl:1
in expression starting at stdin:4
ITensorsVectorInterfaceExt

Failed to precompile ITensorsVectorInterfaceExt [2f1fcacd-197e-560a-aa0f-27cf761d5e85] to "C:\\Users\\u0174972\\.julia\\compiled\\v1.11\\ITensorsVectorInterfaceExt\\jl_F09F.tmp".
ERROR: LoadError: KeyError: key "TypeParameterAccessors" not found
Stacktrace:
  [1] getindex
    @ .\dict.jl:477 [inlined]
  [2] _insert_extension_triggers(parent::Base.PkgId, extensions::Dict{String, Any}, weakdeps::Dict{String, Any})
    @ Base .\loading.jl:1471
  [3] insert_extension_triggers(env::String, pkg::Base.PkgId)
    @ Base .\loading.jl:1434
  [4] insert_extension_triggers
    @ .\loading.jl:1390 [inlined]
  [5] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:2309
  [6] #invoke_in_world#3
    @ .\essentials.jl:1088 [inlined]
  [7] invoke_in_world
    @ .\essentials.jl:1085 [inlined]
  [8] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:2287
  [9] macro expansion
    @ .\loading.jl:2226 [inlined]
 [10] macro expansion
    @ .\lock.jl:273 [inlined]
 [11] __require(into::Module, mod::Symbol)
    @ Base .\loading.jl:2183
 [12] #invoke_in_world#3
    @ .\essentials.jl:1088 [inlined]
 [13] invoke_in_world
    @ .\essentials.jl:1085 [inlined]
 [14] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:2176
 [15] include(mod::Module, _path::String)
    @ Base .\Base.jl:557
 [16] include(x::String)
    @ ITensors C:\Users\u0174972\.julia\packages\ITensors\Zs2nC\src\ITensors.jl:51
 [17] top-level scope
    @ C:\Users\u0174972\.julia\packages\ITensors\Zs2nC\src\ITensors.jl:52
 [18] include
    @ .\Base.jl:557 [inlined]
 [19] 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:2806
 [20] top-level scope
    @ stdin:4
in expression starting at C:\Users\u0174972\.julia\packages\ITensors\Zs2nC\src\usings.jl:14
in expression starting at C:\Users\u0174972\.julia\packages\ITensors\Zs2nC\src\ITensors.jl:1
in expression starting at stdin:4
ERROR: LoadError: Failed to precompile ITensors [9136182c-28ba-11e9-034c-db9fb085ebd5] to "C:\\Users\\u0174972\\.julia\\compiled\\v1.11\\ITensors\\jl_F12C.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; flags::Cmd, cacheflags::Base.CacheFlags, reasons::Dict{String, Int64})
    @ Base .\loading.jl:3089
  [3] (::Base.var"#1081#1082"{Base.PkgId})()
    @ Base .\loading.jl:2477
  [4] mkpidlock(f::Base.var"#1081#1082"{Base.PkgId}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool})
    @ FileWatching.Pidfile C:\Users\u0174972\.julia\juliaup\julia-1.11.0+0.x64.w64.mingw32\share\julia\stdlib\v1.11\FileWatching\src\pidfile.jl:95
  [5] #mkpidlock#6
    @ C:\Users\u0174972\.julia\juliaup\julia-1.11.0+0.x64.w64.mingw32\share\julia\stdlib\v1.11\FileWatching\src\pidfile.jl:90 [inlined]
  [6] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64})
    @ FileWatching.Pidfile C:\Users\u0174972\.julia\juliaup\julia-1.11.0+0.x64.w64.mingw32\share\julia\stdlib\v1.11\FileWatching\src\pidfile.jl:116
  [7] #invokelatest#2
    @ .\essentials.jl:1056 [inlined]
  [8] invokelatest
    @ .\essentials.jl:1051 [inlined]
  [9] maybe_cachefile_lock(f::Base.var"#1081#1082"{Base.PkgId}, pkg::Base.PkgId, srcpath::String; stale_age::Int64)
    @ Base .\loading.jl:3613
 [10] maybe_cachefile_lock
    @ .\loading.jl:3610 [inlined]
 [11] _require(pkg::Base.PkgId, env::String)
    @ Base .\loading.jl:2473
 [12] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:2300
 [13] #invoke_in_world#3
    @ .\essentials.jl:1088 [inlined]
 [14] invoke_in_world
    @ .\essentials.jl:1085 [inlined]
 [15] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:2287
 [16] macro expansion
    @ .\loading.jl:2226 [inlined]
 [17] macro expansion
    @ .\lock.jl:273 [inlined]
 [18] __require(into::Module, mod::Symbol)
    @ Base .\loading.jl:2183
 [19] #invoke_in_world#3
    @ .\essentials.jl:1088 [inlined]
 [20] invoke_in_world
    @ .\essentials.jl:1085 [inlined]
 [21] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:2176
 [22] include
    @ .\Base.jl:557 [inlined]
 [23] 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::Nothing)
    @ Base .\loading.jl:2806
 [24] top-level scope
    @ stdin:4
in expression starting at C:\Users\u0174972\.julia\packages\ITensors\Zs2nC\ext\ITensorsVectorInterfaceExt\ITensorsVectorInterfaceExt.jl:1
in expression starting at stdin:4

Version Info:

Julia Version 1.11.0
Commit 501a4f25c2 (2024-10-07 11:40 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 16 × AMD Ryzen 7 PRO 8840U w/ Radeon 780M Graphics
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, znver3)
Threads: 8 default, 0 interactive, 4 GC (on 16 virtual cores)
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS = 8
@JaydevSR JaydevSR added bug Something isn't working ITensors Issues or pull requests related to the `ITensors` package. labels Feb 17, 2025
@mtfishman
Copy link
Member

I don't have trouble installing or precompiling the package. What other packages do you have installed?

@JaydevSR
Copy link
Author

JaydevSR commented Feb 17, 2025

I am trying to install in a fresh environment (empty project.toml). While installing I get the error:

NDTensors has a malformed Project.toml, the extension package TypeParameterAccessors is not listed in [weakdeps]
Stacktrace:
  [1] pkgerror(::String, ::Vararg{String})
    @ Pkg.Types C:\Users\u0174972\.julia\juliaup\julia-1.11.0+0.x64.w64.mingw32\share\julia\stdlib\v1.11\Pkg\src\Types.jl:68
  [2] status_ext_info(pkg::Pkg.Types.PackageSpec, env::Pkg.Types.EnvCache)
    @ Pkg.Operations C:\Users\u0174972\.julia\juliaup\julia-1.11.0+0.x64.w64.mingw32\share\julia\stdlib\v1.11\Pkg\src\Operations.jl:2302
  [3] print_status(env::Pkg.Types.EnvCache, old_env::Pkg.Types.EnvCache, registries::Vector{…}, header::Symbol, uuids::Vector{…}, names::Vector{…}; manifest::Bool, diff::Bool, ignore_indent::Bool, outdated::Bool, extensions::Bool, io::IOContext{…}, mode::Pkg.Types.PackageMode, hidden_upgrades_info::Bool, show_usagetips::Bool)
    @ Pkg.Operations C:\Users\u0174972\.julia\juliaup\julia-1.11.0+0.x64.w64.mingw32\share\julia\stdlib\v1.11\Pkg\src\Operations.jl:2394
  [4] print_status
    @ C:\Users\u0174972\.julia\juliaup\julia-1.11.0+0.x64.w64.mingw32\share\julia\stdlib\v1.11\Pkg\src\Operations.jl:2332 [inlined]
  [5] status(env::Pkg.Types.EnvCache, registries::Vector{…}, pkgs::Vector{…}; header::Symbol, mode::Pkg.Types.PackageMode, git_diff::Bool, env_diff::Pkg.Types.EnvCache, ignore_indent::Bool, io::IOContext{…}, outdated::Bool, extensions::Bool, hidden_upgrades_info::Bool, show_usagetips::Bool)
    @ Pkg.Operations C:\Users\u0174972\.julia\juliaup\julia-1.11.0+0.x64.w64.mingw32\share\julia\stdlib\v1.11\Pkg\src\Operations.jl:2567
  [6] status (repeats 2 times)
    @ C:\Users\u0174972\.julia\juliaup\julia-1.11.0+0.x64.w64.mingw32\share\julia\stdlib\v1.11\Pkg\src\Operations.jl:2535 [inlined]
  [7] #show_update#170
    @ C:\Users\u0174972\.julia\juliaup\julia-1.11.0+0.x64.w64.mingw32\share\julia\stdlib\v1.11\Pkg\src\Operations.jl:2531 [inlined]
  [8] add(ctx::Pkg.Types.Context, pkgs::Vector{…}, new_git::Set{…}; allow_autoprecomp::Bool, preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform, target::Symbol)
    @ Pkg.Operations C:\Users\u0174972\.julia\juliaup\julia-1.11.0+0.x64.w64.mingw32\share\julia\stdlib\v1.11\Pkg\src\Operations.jl:1452
  [9] add
    @ C:\Users\u0174972\.julia\juliaup\julia-1.11.0+0.x64.w64.mingw32\share\julia\stdlib\v1.11\Pkg\src\Operations.jl:1400 [inlined]
 [10] add(ctx::Pkg.Types.Context, pkgs::Vector{…}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform, target::Symbol, allow_autoprecomp::Bool, kwargs::@Kwargs{})
    @ Pkg.API C:\Users\u0174972\.julia\juliaup\julia-1.11.0+0.x64.w64.mingw32\share\julia\stdlib\v1.11\Pkg\src\API.jl:306
 [11] add(pkgs::Vector{Pkg.Types.PackageSpec}; io::IOContext{IO}, kwargs::@Kwargs{allow_autoprecomp::Bool})
    @ Pkg.API C:\Users\u0174972\.julia\juliaup\julia-1.11.0+0.x64.w64.mingw32\share\julia\stdlib\v1.11\Pkg\src\API.jl:159
 [12] add
    @ C:\Users\u0174972\.julia\juliaup\julia-1.11.0+0.x64.w64.mingw32\share\julia\stdlib\v1.11\Pkg\src\API.jl:147 [inlined]
 [13] try_prompt_pkg_add(pkgs::Vector{Symbol})
    @ REPLExt C:\Users\u0174972\.julia\juliaup\julia-1.11.0+0.x64.w64.mingw32\share\julia\stdlib\v1.11\Pkg\ext\REPLExt\REPLExt.jl:248
 [14] #invokelatest#2
    @ .\essentials.jl:1054 [inlined]
 [15] invokelatest
    @ .\essentials.jl:1051 [inlined]
 [16] check_for_missing_packages_and_run_hooks(ast::Any)
    @ REPL C:\Users\u0174972\.julia\juliaup\julia-1.11.0+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:251
 [17] eval_user_input(ast::Any, backend::REPL.REPLBackend, mod::Module)
    @ REPL C:\Users\u0174972\.julia\juliaup\julia-1.11.0+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:222
 [18] repl_backend_loop(backend::REPL.REPLBackend, get_module::Function)
    @ REPL C:\Users\u0174972\.julia\juliaup\julia-1.11.0+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:323
 [19] start_repl_backend(backend::REPL.REPLBackend, consumer::Any; get_module::Function)
    @ REPL C:\Users\u0174972\.julia\juliaup\julia-1.11.0+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:308
 [20] run_repl(repl::REPL.AbstractREPL, consumer::Any; backend_on_current_task::Bool, backend::Any)
    @ REPL C:\Users\u0174972\.julia\juliaup\julia-1.11.0+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:464
 [21] run_repl(repl::REPL.AbstractREPL, consumer::Any)
    @ REPL C:\Users\u0174972\.julia\juliaup\julia-1.11.0+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:450
 [22] (::Base.var"#1138#1140"{Bool, Symbol, Bool})(REPL::Module)
    @ Base .\client.jl:446
 [23] #invokelatest#2
    @ .\essentials.jl:1054 [inlined]
 [24] invokelatest
    @ .\essentials.jl:1051 [inlined]
 [25] run_main_repl(interactive::Bool, quiet::Bool, banner::Symbol, history_file::Bool, color_set::Bool)
    @ Base .\client.jl:430
 [26] repl_main
    @ .\client.jl:567 [inlined]
 [27] _start()
    @ Base .\client.jl:541
Some type information was truncated. Use `show(err)` to see complete types.

and then the above error in the main post when I try to precompile again. So it seems the problem is with NDTensors.jl?

@mtfishman
Copy link
Member

I see you are using Julia v1.11.0, can you try the latest release (Julia v1.11.3) instead? I think there were some issues with certain package extension setups in older Julia v1.11 releases.

@JaydevSR
Copy link
Author

Thanks! Updating the julia version worked.

@mtfishman
Copy link
Member

This is getting fixed properly in #1623, so when you upgrade to NDTensors v0.4.4 you can use the latest version of ITensors.jl with any Julia v1.10 or v1.11 releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ITensors Issues or pull requests related to the `ITensors` package.
Projects
None yet
Development

No branches or pull requests

2 participants