I want to call some functions from the Python package matplotlib in Julia through PythonCall.jl. However, it prompts version 'CXXABI_1.3.15' not found. Here is the error message:
julia> using PythonCall
julia> plt=pyimport("matplotlib")
ERROR: Python: ImportError: /home/.julia/juliaup/julia-1.10.10+0.x64.linux.gnu/bin/../lib/julia/libstdc++.so.6: version `CXXABI_1.3.15' not found (required by /data/julia-depot/environments/v1.10/.CondaPkg/.pixi/envs/default/lib/python3.12/site-packages/matplotlib/_c_internal_utils.cpython-312-x86_64-linux-gnu.so)
Within Python I can import matplotlib without error, but I just cannot do that in Julia. Does this mean that the libstdc++ shipped in Julia is outdated? And how to solve it?
I believe the problem is that the system libstdc++ on your fist machine is old, which would explain why it works on the second machine but not on the first.
Can you post the full output from versioninfo() and CondaPkg.resolve(force=true) in the non-working environment please, assuming you are using the default CondaPkg to install python dependencies.
Thank you Uwe, I saw your post about installing PyPlot and tried your solution, but it is not working for my situation. It still prompts the same error.
julia> versioninfo()
Julia Version 1.10.10
Commit 95f30e51f41 (2025-06-27 09:51 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 64 × Intel(R) Xeon(R) Gold 6242 CPU @ 2.80GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, cascadelake)
Threads: 1 default, 0 interactive, 1 GC (on 64 virtual cores)
Environment:
LD_LIBRARY_PATH = /home/.julia/conda/3/x86_64/lib:/home/.julia/juliaup/
LD_LIBRARY_PATH_modshare = /opt/FJSVxtclanga/tcsds-1.2.41/lib64:1:/home/apps/oss/mscp/lib64:1
JULIA_CONDAPKG_BACKEND = Pixi
julia> using PythonCall
julia> pyimport("matplotlib")
ERROR: Python: ImportError: /vol0004/mdt0/home/.julia/juliaup/julia-1.10.10+0.x64.linux.gnu/bin/../lib/julia/libstdc++.so.6: version `CXXABI_1.3.15' not found (required by /home/.julia/environments/v1.10/.CondaPkg/.pixi/envs/default/lib/python3.12/site-packages/matplotlib/_c_internal_utils.cpython-312-x86_64-linux-gnu.so)
Sorry for this naive question, the error message says ImportError: /vol0004/mdt0/home/u13411/.julia/juliaup/julia-1.10.10+0.x64.linux.gnu/bin/../lib/julia/libstdc++.so.6: version 'CXXABI_1.3.15' not found, does this mean that Julia is looking for CXXABI_1.3.15 in its own libstdc++?
It is quite strange that my scripts have been working well with matplotlib well on this HPC for more than 6 months. After I updating Julia packages last Sunday, the version 'CXXABI_1.3.15' not found error appears. I really don’t know which part did I break…
The issue is indeed an incompatibility between the version of libstdc++ shipped with Julia and the (newer) one expected by matplotlib.
The compat bound libstdcxx-ng = ">=3.4,<14.0" that you see in the CondaPkg.resolve() output is supposed to solve this, by restricting Conda to only expect versions older than what is in Julia (because older versions will be ABI compatible with what is loaded).
However the error you are seeing suggests that actually libstdc++ 14.1 is expected, which is outside of this range.
Conda has installed libstdcxx-ng 13.2 but libstdcxx 15.1, which I suspect is the problem. CondaPkg doesn’t restrict the latter.
Can you try running the following and then see if matplotlib works?
After using CondaPkg.add("libstdcxx", version="<14.0"), matplotlib is automatically downgraded from v3.10.5 to v3.10.3, and I can pyimport without error now.
That needs to be worked out in the future, to be able to use latest version of some packages like matplotlib, so here is only a partial solution, workaround. I don’t know what you’re missing out on in that later (minor, actually patch version) matplotlib… consider using Makie (or Plots).
Yes, my workflow is relying on a Python package yt to read AMReX data, then plot the post-processed data with Makie, which works perfectly as I am more familiar with Julia ecosystem.
However yt depends on matplotlib (although I don’t need it in my workflow), so I couldn’t use yt earlier because of the incompatibility of matplotlib. I thought users of matplotlib must be more than those of yt, so I mentioned matplotlib in the title : )