Closed
Description
Issue
The most recent version of matplotlib (v3.9.0) released on May 16 is incompatible with PythonPlot.jl.
Minimal reproducible example
In a directory with no .CondaPkg/, I run
using PythonPlot
and encounter the following error:
ERROR: InitError: Python: AttributeError: module 'matplotlib.cm' has no attribute 'get_cmap'
Python stacktrace: none
Stacktrace:
[1] pythrow()
@ PythonCall.Core ~/.julia/packages/PythonCall/S5MOg/src/Core/err.jl:92
[2] errcheck
@ ~/.julia/packages/PythonCall/S5MOg/src/Core/err.jl:10 [inlined]
[3] pygetattr(x::PythonCall.Core.Py, k::String)
@ PythonCall.Core ~/.julia/packages/PythonCall/S5MOg/src/Core/builtins.jl:62
[4] getproperty
@ ~/.julia/packages/PythonCall/S5MOg/src/Core/Py.jl:257 [inlined]
[5] init_colormaps()
@ PythonPlot ~/.julia/packages/PythonPlot/KcWMF/src/colormaps.jl:51
[6] __init__()
@ PythonPlot ~/.julia/packages/PythonPlot/KcWMF/src/init.jl:180
[7] run_module_init(mod::Module, i::Int64)
@ Base ./loading.jl:1134
[8] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
@ Base ./loading.jl:1122
[9] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
@ Base ./loading.jl:1067
[10] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
@ Base ./loading.jl:1581
[11] _require(pkg::Base.PkgId, env::String)
@ Base ./loading.jl:1938
[12] __require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base ./loading.jl:1812
[13] #invoke_in_world#3
@ ./essentials.jl:926 [inlined]
[14] invoke_in_world
@ ./essentials.jl:923 [inlined]
[15] _require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base ./loading.jl:1803
[16] macro expansion
@ ./loading.jl:1790 [inlined]
[17] macro expansion
@ ./lock.jl:267 [inlined]
[18] __require(into::Module, mod::Symbol)
@ Base ./loading.jl:1753
[19] #invoke_in_world#3
@ ./essentials.jl:926 [inlined]
[20] invoke_in_world
@ ./essentials.jl:923 [inlined]
[21] require(into::Module, mod::Symbol)
@ Base ./loading.jl:1746
during initialization of module PythonPlot
Environment
In this demonstration, I used a clean environment with
[274fc56d] PythonPlot v1.0.3
and its dependencies
[3da002f7] ColorTypes v0.11.5
[5ae59095] Colors v0.12.11
[992eb4ea] CondaPkg v0.2.22
[9a962f9c] DataAPI v1.16.0
[e2d170a0] DataValueInterfaces v1.0.0
[53c48c17] FixedPointNumbers v0.8.5
[82899510] IteratorInterfaceExtensions v1.0.0
[692b3bcd] JLLWrappers v1.5.0
[0f8b85d8] JSON3 v1.14.0
[b964fa9f] LaTeXStrings v1.3.1
[1914dd2f] MacroTools v0.5.13
[0b3b1443] MicroMamba v0.1.14
[bac558e1] OrderedCollections v1.6.3
[69de0a69] Parsers v2.8.1
[fa939f87] Pidfile v1.3.0
[aea7be01] PrecompileTools v1.2.1
[21216c6a] Preferences v1.4.3
[6099a3de] PythonCall v0.9.20
[274fc56d] PythonPlot v1.0.3
[189a3867] Reexport v1.2.2
[ae029012] Requires v1.3.0
[6c6a2e73] Scratch v1.2.1
[856f2bd8] StructTypes v1.10.0
[3783bdb8] TableTraits v1.0.1
[bd369af6] Tables v1.11.1
[e17b2a0c] UnsafePointers v1.0.0
[81def892] VersionParsing v1.3.0
[f8abcde7] micromamba_jll v1.5.8+0
[0dad84c5] ArgTools v1.1.1
[56f22d72] Artifacts
[2a0f44e3] Base64
[ade2ca70] Dates
[f43a241f] Downloads v1.6.0
[7b1f6079] FileWatching
[b77e0a4c] InteractiveUtils
[4af54fe1] LazyArtifacts
[b27032c2] LibCURL v0.6.4
[76f85450] LibGit2
[8f399da3] Libdl
[37e2e46d] LinearAlgebra
[56ddb016] Logging
[d6f4376e] Markdown
[a63ad114] Mmap
[ca575930] NetworkOptions v1.2.0
[44cfe95a] Pkg v1.10.0
[de0858da] Printf
[3fa0cd96] REPL
[9a3f8284] Random
[ea8e919c] SHA v0.7.0
[9e88b42a] Serialization
[6462fe0b] Sockets
[2f01184e] SparseArrays v1.10.0
[10745b16] Statistics v1.10.0
[fa267f1f] TOML v1.0.3
[a4e569a6] Tar v1.10.0
[8dfed614] Test
[cf7118a7] UUIDs
[4ec0a83e] Unicode
[e66e0078] CompilerSupportLibraries_jll v1.1.1+0
[deac9b47] LibCURL_jll v8.4.0+0
[e37daf67] LibGit2_jll v1.6.4+0
[29816b5a] LibSSH2_jll v1.11.0+1
[c8ffd9c3] MbedTLS_jll v2.28.2+1
[14a3606d] MozillaCACerts_jll v2023.1.10
[4536629a] OpenBLAS_jll v0.3.23+4
[bea87d4a] SuiteSparse_jll v7.2.1+1
[83775a58] Zlib_jll v1.2.13+1
[8e850b90] libblastrampoline_jll v5.8.0+1
[8e850ede] nghttp2_jll v1.52.0+1
[3f19e933] p7zip_jll v17.4.0+2
Solution
An obvious, quick solution to this is to restrict matplotlib's version in the CondaPkg.toml.
Metadata
Metadata
Assignees
Labels
No labels