I was loading an old Julia environment (maybe half a year old? It is 1.10.4). I then run
julia> using Plots
julia> pythonplot()
And get a
ERROR: InitError: PythonCall.PyException(PythonCall.Py(Ptr{PythonCall.C.PyObject} @0x00007420cfecb0c0), PythonCall.Py(Ptr{PythonCall.C.PyObject} @0x0000742105fe77c0), PythonCall.Py(Ptr{PythonCall.C.PyObject} @0x00007421060f4500), false)
Stacktrace:
[1] pythrow()
@ PythonCall ~/.julia/packages/PythonCall/qTEA1/src/err.jl:94
[2] errcheck
@ ~/.julia/packages/PythonCall/qTEA1/src/err.jl:10 [inlined]
[3] pycontains
@ ~/.julia/packages/PythonCall/qTEA1/src/abstract/object.jl:298
[4] haskey
@ ~/.julia/packages/PythonCall/qTEA1/src/pywrap/PyDict.jl:76 [inlined]
[5] get
@ ~/.julia/packages/PythonCall/qTEA1/src/pywrap/PyDict.jl:81 [inlined]
[6] getnone(dict::PythonCall.PyDict{Any, Any}, key::String, default::String)
@ PythonPlot ~/.julia/packages/PythonPlot/KcWMF/src/init.jl:38
[7] find_backend(matplotlib::PythonCall.Py)
@ PythonPlot ~/.julia/packages/PythonPlot/KcWMF/src/init.jl:66
[8] init()
@ PythonPlot ~/.julia/packages/PythonPlot/KcWMF/src/init.jl:157
[9] run_module_init(mod::Module, i::Int64)
@ Base ./loading.jl:1134
[10] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
@ Base ./loading.jl:1122
[11] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
@ Base ./loading.jl:1067
[12] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
@ Base ./loading.jl:1581
[13] _require(pkg::Base.PkgId, env::String)
@ Base ./loading.jl:1938
[14] __require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base ./loading.jl:1812
[15] #invoke_in_world#3
@ ./essentials.jl:926 [inlined]
[16] invoke_in_world
@ ./essentials.jl:923 [inlined]
[17] _require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base ./loading.jl:1803
[18] macro expansion
@ ./loading.jl:1790 [inlined]
[19] macro expansion
@ ./lock.jl:267 [inlined]
[20] __require(into::Module, mod::Symbol)
@ Base ./loading.jl:1753
[21] #invoke_in_world#3
@ ./essentials.jl:926 [inlined]
[22] invoke_in_world
@ ./essentials.jl:923 [inlined]
[23] require(into::Module, mod::Symbol)
@ Base ./loading.jl:1746
[24] top-level scope
@ ~/.julia/packages/Plots/sxUvK/src/backends.jl:1084
during initialization of module PythonPlot
Any idea how to fix this? I initialised the old environment, and use the same Julia version, so figured this should all be fine? But maybe it is because python is involved that the old environment is not entirely recreated, and that messes things up?