I am developing a package that uses PythonCall.
The first time I import my package I get the error:
ERROR: InitError: KeyError: key Base.PkgId(Base.UUID("6099a3de-0909-46bc-b1f4-468b9a2dfc0d"), "PythonCall") not found
Stacktrace:
[1] getindex
@ ./dict.jl:477 [inlined]
[2] macro expansion
@ ./lock.jl:273 [inlined]
[3] root_module(key::Base.PkgId)
@ Base ./loading.jl:2471
[4] parse_pkg_files(id::Base.PkgId)
@ Revise ~/.julia/packages/Revise/uvGMC/src/loading.jl:49
[5] watch_package(id::Base.PkgId)
@ Revise ~/.julia/packages/Revise/uvGMC/src/pkgs.jl:350
[6] add_require(sourcefile::String, modcaller::Module, idmod::String, modname::String, expr::Expr)
@ Revise ~/.julia/packages/Revise/uvGMC/src/pkgs.jl:189
[7] withnotifications(::Any, ::Vararg{Any})
@ Requires ~/.julia/packages/Requires/1eCOK/src/require.jl:70
[8] (::PythonCall.Compat.var"#24#27")()
@ PythonCall.Compat ~/.julia/packages/Requires/1eCOK/src/require.jl:106
[9] listenpkg(f::Any, pkg::Base.PkgId)
@ Requires ~/.julia/packages/Requires/1eCOK/src/require.jl:20
[10] macro expansion
@ ~/.julia/packages/Requires/1eCOK/src/require.jl:98 [inlined]
[11] init_tables()
@ PythonCall.Compat ~/.julia/packages/PythonCall/WMWY0/src/Compat/tables.jl:69
[12] __init__()
@ PythonCall.Compat ~/.julia/packages/PythonCall/WMWY0/src/Compat/Compat.jl:39
[13] run_module_init(mod::Module, i::Int64)
@ Base ./loading.jl:1378
[14] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
@ Base ./loading.jl:1366
[15] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{…}, ignore_native::Nothing; register::Bool)
@ Base ./loading.jl:1254
[16] _include_from_serialized (repeats 2 times)
@ ./loading.jl:1210 [inlined]
[17] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128, stalecheck::Bool; reasons::Dict{…}, DEPOT_PATH::Vector{…})
@ Base ./loading.jl:2041
[18] _require(pkg::Base.PkgId, env::String)
@ Base ./loading.jl:2527
[19] __require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base ./loading.jl:2388
[20] #invoke_in_world#3
@ ./essentials.jl:1089 [inlined]
[21] invoke_in_world
@ ./essentials.jl:1086 [inlined]
[22] _require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base ./loading.jl:2375
[23] macro expansion
@ ./loading.jl:2314 [inlined]
[24] macro expansion
@ ./lock.jl:273 [inlined]
[25] __require(into::Module, mod::Symbol)
@ Base ./loading.jl:2271
[26] #invoke_in_world#3
@ ./essentials.jl:1089 [inlined]
[27] invoke_in_world
@ ./essentials.jl:1086 [inlined]
[28] require(into::Module, mod::Symbol)
@ Base ./loading.jl:2260
during initialization of module Compat
Some type information was truncated. Use `show(err)` to see complete types.
Then, if I import it again, it works.
Any hints where to look at ?
EDIT:
This happens only if I use Revise
before, otherwise it works on the first “attempt”