I’m new to Julia, I had a project that was using ControlSystems and SparseArrays packages. After the weekend I came back to the office, lauched a test, and nothing was working. Basically it says that I cannot compile ControlSystems (why does it need to compile it again?) because the Key SparseArrays is missing.
I spent 4h trying to debug the issue, and I’ve tried everything I could find, including all Pkg.x() commands (all failing with the same error “ERROR: KeyError: key “SparseArrays” not found”), and also deleting all local Julia Package, compiled, and environment files and restarting, just to find myself at the same point.
I’m kinda of lost, and a bit upset (I wanted to try Julia so much to move away from the shitty Python packages creating issues all the time).
Stack trace of me trying to recompile ControlSystems after I reset everything
ERROR: LoadError: Failed to precompile ControlSystems [a6e380b2-a6ca-5380-bf3e-84a91bcd477e] to "/path/.julia/compiled/v1.10/ControlSystems/jl_VwYKFv".
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:2468
[3] compilecache
@ ./loading.jl:2340 [inlined]
[4] (::Base.var"#968#969"{Base.PkgId})()
@ Base ./loading.jl:1974
[5] mkpidlock(f::Base.var"#968#969"{Base.PkgId}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool})
@ FileWatching.Pidfile /tools/foss/julia/1.10.4/x86_64/gen_linux/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:93
[6] #mkpidlock#6
@ /tools/foss/julia/1.10.4/x86_64/gen_linux/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:88 [inlined]
[7] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64})
@ FileWatching.Pidfile /tools/foss/julia/1.10.4/x86_64/gen_linux/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:111
[8] #invokelatest#2
@ ./essentials.jl:894 [inlined]
[9] invokelatest
@ ./essentials.jl:889 [inlined]
[10] maybe_cachefile_lock(f::Base.var"#968#969"{Base.PkgId}, pkg::Base.PkgId, srcpath::String; stale_age::Int64)
@ Base ./loading.jl:2983
[11] maybe_cachefile_lock
@ ./loading.jl:2980 [inlined]
[12] _require(pkg::Base.PkgId, env::String)
@ Base ./loading.jl:1970
[13] __require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base ./loading.jl:1812
[14] #invoke_in_world#3
@ ./essentials.jl:926 [inlined]
[15] invoke_in_world
@ ./essentials.jl:923 [inlined]
[16] _require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base ./loading.jl:1803
[17] macro expansion
@ ./loading.jl:1790 [inlined]
[18] macro expansion
@ ./lock.jl:267 [inlined]
[19] __require(into::Module, mod::Symbol)
@ Base ./loading.jl:1753
[20] #invoke_in_world#3
@ ./essentials.jl:926 [inlined]
[21] invoke_in_world
@ ./essentials.jl:923 [inlined]
[22] require(into::Module, mod::Symbol)
@ Base ./loading.jl:1746
[23] include(fname::String)
@ Base.MainInclude ./client.jl:489
[24] top-level scope
@ /path/test_sim.jl:9
Stacktrace of a Pkg.resolve()
ERROR: KeyError: key "SparseArrays" not found
Stacktrace:
[1] getindex
@ ./dict.jl:498 [inlined]
[2] status_ext_info(pkg::Pkg.Types.PackageSpec, env::Pkg.Types.EnvCache)
@ Pkg.Operations /tools/foss/julia/1.10.4/x86_64/gen_linux/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:2214
[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::Base.TTY, mode::Pkg.Types.PackageMode, hidden_upgrades_info::Bool, show_usagetips::Bool)
@ Pkg.Operations /tools/foss/julia/1.10.4/x86_64/gen_linux/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:2299
[4] print_status
@ /tools/foss/julia/1.10.4/x86_64/gen_linux/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:2241 [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::Base.TTY, outdated::Bool, extensions::Bool, hidden_upgrades_info::Bool, show_usagetips::Bool)
@ Pkg.Operations /tools/foss/julia/1.10.4/x86_64/gen_linux/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:2475
[6] status (repeats 2 times)
@ /tools/foss/julia/1.10.4/x86_64/gen_linux/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:2443 [inlined]
[7] #show_update#167
@ /tools/foss/julia/1.10.4/x86_64/gen_linux/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:2439 [inlined]
[8] up(ctx::Pkg.Types.Context, pkgs::Vector{…}, level::Pkg.Types.UpgradeLevel; skip_writing_project::Bool, preserve::Nothing)
@ Pkg.Operations /tools/foss/julia/1.10.4/x86_64/gen_linux/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:1545
[9] up
@ /tools/foss/julia/1.10.4/x86_64/gen_linux/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:1520 [inlined]
[10] up(ctx::Pkg.Types.Context, pkgs::Vector{…}; level::Pkg.Types.UpgradeLevel, mode::Pkg.Types.PackageMode, preserve::Nothing, update_registry::Bool, skip_writing_project::Bool, kwargs::@Kwargs{})
@ Pkg.API /tools/foss/julia/1.10.4/x86_64/gen_linux/share/julia/stdlib/v1.10/Pkg/src/API.jl:351
[11] up
@ /tools/foss/julia/1.10.4/x86_64/gen_linux/share/julia/stdlib/v1.10/Pkg/src/API.jl:326 [inlined]
[12] up
@ /tools/foss/julia/1.10.4/x86_64/gen_linux/share/julia/stdlib/v1.10/Pkg/src/API.jl:164 [inlined]
[13] #resolve#143
@ /tools/foss/julia/1.10.4/x86_64/gen_linux/share/julia/stdlib/v1.10/Pkg/src/API.jl:357 [inlined]
[14] resolve
@ /tools/foss/julia/1.10.4/x86_64/gen_linux/share/julia/stdlib/v1.10/Pkg/src/API.jl:356 [inlined]
[15] resolve(; io::Base.TTY, kwargs::@Kwargs{})
@ Pkg.API /tools/foss/julia/1.10.4/x86_64/gen_linux/share/julia/stdlib/v1.10/Pkg/src/API.jl:355
[16] top-level scope
@ REPL[5]:1
Some type information was truncated. Use `show(err)` to see complete types.