Skip to content
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

Problem adding ITensors #1620

Closed
gach213 opened this issue Feb 20, 2025 · 5 comments
Closed

Problem adding ITensors #1620

gach213 opened this issue Feb 20, 2025 · 5 comments

Comments

@gach213
Copy link

gach213 commented Feb 20, 2025

Hi,
I am new to using ITenosrs. I am trying to do the standard add ITenosrs in Julia REPL but I am getting an error (Because of its long trace, I am just copying at the end). I tried standard commands like resolve, precompile but did not help. Not sure if it's even important, and perhaps I can still use it for my purpose.

KeyError: key "TypeParameterAccessors" not found
Stacktrace:
[1] getindex
@ ./dict.jl:498 [inlined]
[2] status_ext_info(pkg::Pkg.Types.PackageSpec, env::Pkg.Types.EnvCache)
@ Pkg.Operations /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:2214
[3] print_status(env::Pkg.Types.EnvCache, old_env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, header::Symbol, uuids::Vector{Base.UUID}, names::Vector{String}; manifest::Bool, diff::Bool, ignore_indent::Bool, outdated::Bool, extensions::Bool, io::Base.TTY, mode::Pkg.Types.PackageMode, hidden_upgrades_info::Bool, show_usagetips::Bool)
@ Pkg.Operations /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:2299
[4] print_status
@ /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:2241 [inlined]
[5] status(env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}; header::Symbol, mode::Pkg.Types.PackageMode, git_diff::Bool, env_diff::Pkg.Types.EnvCache, ignore_indent::Bool, io::Base.TTY, outdated::Bool, extensions::Bool, hidden_upgrades_info::Bool, show_usagetips::Bool)
@ Pkg.Operations /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:2475
[6] status (repeats 2 times)
@ /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:2443 [inlined]
[7] #show_update#167
@ /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:2439 [inlined]
[8] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, new_git::Set{Base.UUID}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform)
@ Pkg.Operations /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:1398
[9] add
@ /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:1377 [inlined]
[10] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform, kwargs::@kwargs{io::Base.TTY})
@ Pkg.API /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/API.jl:278
[11] add(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::@kwargs{})
@ Pkg.API /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/API.jl:159
[12] add(pkgs::Vector{Pkg.Types.PackageSpec})
@ Pkg.API /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/API.jl:148
[13] do_cmd!(command::Pkg.REPLMode.Command, repl::REPL.LineEditREPL)
@ Pkg.REPLMode /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/REPLMode/REPLMode.jl:412
[14] do_cmd(repl::REPL.LineEditREPL, input::String; do_rethrow::Bool)
@ Pkg.REPLMode /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/REPLMode/REPLMode.jl:390
[15] do_cmd
@ /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/REPLMode/REPLMode.jl:380 [inlined]
[16] (::Pkg.REPLMode.var"#24#27"{REPL.LineEditREPL, REPL.LineEdit.Prompt})(s::REPL.LineEdit.MIState, buf::IOBuffer, ok::Bool)
@ Pkg.REPLMode /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/REPLMode/REPLMode.jl:557
[17] #invokelatest#2
@ ./essentials.jl:892 [inlined]
[18] invokelatest
@ ./essentials.jl:889 [inlined]
[19] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
@ REPL.LineEdit /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/REPL/src/LineEdit.jl:2656
[20] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
@ REPL /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/REPL/src/REPL.jl:1312
[21] (::REPL.var"#62#68"{REPL.LineEditREPL, REPL.REPLBackendRef})()
@ REPL /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/REPL/src/REPL.jl:386

@mtfishman
Copy link
Member

This looks like a duplicate of #1618, what version of Julia are you using? Please try Julia v1.11.3 if you are using an older version, unfortunately there is a bug in older Julia 1.11 versions when installing packages that are set up in certain ways, including how we have set up ITensors.jl.

@gach213
Copy link
Author

gach213 commented Feb 20, 2025

Thanks a lot! Works with 1.11.3. I was using 1.10.4, where I had this problem. Strangely, I also tried in our HPC cluster, which has Julia 1.7.3 installed, and I had no problem.

@mtfishman
Copy link
Member

Thanks for confirming, glad that fixed it. That's too bad that Julia v1.10.4 has the same problem. I just tried installing on Julia v1.10.8 which worked as well, so using the latest versions of either Julia v1.10 or v1.11 should be fine.

Julia v1.7.3 is a different situation since we dropped support for Julia versions below v1.10 in more recent versions of ITensors.jl, so if you install ITensors.jl in those older versions of Julia it will only install older versions of ITensors.jl which are configured in a different way where this kind of issue wouldn't show up (basically it is caused by subtleties around package extensions, which is a newer feature in Julia).

Unfortunately I don't know of a simple way to fix this problem in older versions of Julia v1.10 or v1.11 but in general users should be using the latest official releases anyway.

@mtfishman
Copy link
Member

I've added a note about this issue to the NEWS sections of the README/docs: https://github.com/ITensor/ITensors.jl/tree/main?tab=readme-ov-file#news.

@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
None yet
Projects
None yet
Development

No branches or pull requests

2 participants