Version `CXXABI_1.3.15' not found when loading matplotlib through PythonCall

Hi folks,

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?

Thank you!

What version of Julia are you using?

Hi Mosè, I tried both v1.11.6 and v1.10.10.

On another computer running v1.11.5, however, I can successfully pyimport("matplotlab").

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.

This seems to be a conflict between Python version and Julia version. Your Python could be too new (and/or Julia too new).

Please show what this gives you:

julia> sys=pyimport("sys"); sys.version_info
Python: sys.version_info(major=3, minor=12, micro=11, releaselevel='final', serial=0)

julia> VERSION
v"1.11.6"

This works for me in Julia 1.10.10 but not in 1.11.6. If I recall, it’s because Python 3.12 changed from older and/or change in Julia.

This file works for me in 1.11 (but not if I ask for Python 3.13):
.julia/environments/v1.11/CondaPkg.toml

[deps]
# conda-forge = ""
numpy = ""
python = "==3.10" # before "" # "==3.13"
matplotlib = ""
# openssl = ">=3.3.2,<4.0a0"
1 Like

Try something along the lines:

export LD_LIBRARY_PATH=~/.julia/conda/3/x86_64/lib:~/.julia/juliaup/

Does that help?

Sure. Here is the output:

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 = /opt/FJSVxtclanga/tcsds-1.2.41/lib64:/home/apps/oss/mscp/lib64
  LD_LIBRARY_PATH_modshare = /opt/FJSVxtclanga/tcsds-1.2.41/lib64:1:/home/apps/oss/mscp/lib64:1
  JULIA_CONDAPKG_BACKEND = Pixi

julia> CondaPkg.resolve(force=true)
    CondaPkg Found dependencies: /home/.julia/environments/v1.10/CondaPkg.toml
    CondaPkg Found dependencies: /home/.julia/packages/PythonCall/avYrV/CondaPkg.toml
    CondaPkg Initialising pixi
             │ /home/.julia/artifacts/cefba4912c2b400756d043a2563ef77a0088866b/bin/pixi
             │ init
             │ --format pixi
             └ /home/.julia/environments/v1.10/.CondaPkg
Created /vol0004/mdt0/home/.julia/environments/v1.10/.CondaPkg/pixi.toml
    CondaPkg Wrote /home/.julia/environments/v1.10/.CondaPkg/pixi.toml
             │ [dependencies]
             │ openssl = ">=3, <3.6"
             │ libstdcxx-ng = ">=3.4,<14.0"
             │ yt = "*"
             │
             │     [dependencies.python]
             │     channel = "conda-forge"
             │     build = "*cpython*"
             │     version = ">=3.8,<4"
             │
             │ [project]
             │ name = ".CondaPkg"
             │ platforms = ["linux-64"]
             │ channels = ["conda-forge"]
             │ channel-priority = "strict"
             └ description = "automatically generated by CondaPkg.jl"
    CondaPkg Installing packages
             │ /home/.julia/artifacts/cefba4912c2b400756d043a2563ef77a0088866b/bin/pixi
             │ update
             └ --manifest-path /home/.julia/environments/v1.10/.CondaPkg/pixi.toml
Environment: default
  + C _libgcc_mutex            0.1 conda_forge
  + C _openmp_mutex            4.5 2_gnu
  + C asttokens                3.0.0 pyhd8ed1ab_1
  + C brotli                   1.1.0 hb9d3cd8_3
  + C brotli-bin               1.1.0 hb9d3cd8_3
  + C bzip2                    1.0.8 h4bc722e_7
  + C ca-certificates          2025.8.3 hbd8a1cb_0
  + C cmyt                     2.0.2 pyhd8ed1ab_0
  + C colorama                 0.4.6 pyhd8ed1ab_1
  + C comm                     0.2.3 pyhe01879c_0
  + C contourpy                1.3.3 py312hd9148b4_1
  + C cpython                  3.12.11 py312hd8ed1ab_0
  + C cycler                   0.12.1 pyhd8ed1ab_1
  + C decorator                5.2.1 pyhd8ed1ab_0
  + C ewah-bool-utils          1.3.0 py312hcbe3ca9_0
  + C exceptiongroup           1.3.0 pyhd8ed1ab_0
  + C executing                2.2.0 pyhd8ed1ab_0
  + C fonttools                4.59.1 py312h8a5da7c_0
  + C freetype                 2.13.3 ha770c72_1
  + C gmp                      6.3.0 hac33072_2
  + C gmpy2                    2.2.1 py312h7201bc8_0
  + C ipython                  9.4.0 pyhfa0c392_0
  + C ipython_pygments_lexers  1.1.1 pyhd8ed1ab_0
  + C ipywidgets               8.1.7 pyhd8ed1ab_0
  + C jedi                     0.19.2 pyhd8ed1ab_1
  + C jupyterlab_widgets       3.0.15 pyhd8ed1ab_0
  + C kiwisolver               1.4.9 py312h0a2e395_0
  + C lcms2                    2.17 h717163a_0
  + C ld_impl_linux-64         2.44 h1423503_1
  + C lerc                     4.0.0 h0aef613_1
  + C libblas                  3.9.0 34_h59b9bed_openblas
  + C libbrotlicommon          1.1.0 hb9d3cd8_3
  + C libbrotlidec             1.1.0 hb9d3cd8_3
  + C libbrotlienc             1.1.0 hb9d3cd8_3
  + C libcblas                 3.9.0 34_he106b2a_openblas
  + C libdeflate               1.24 h86f0d12_0
  + C libexpat                 2.7.1 hecca717_0
  + C libffi                   3.4.6 h2dba641_1
  + C libfreetype              2.13.3 ha770c72_1
  + C libfreetype6             2.13.3 h48d6fc4_1
  + C libgcc                   15.1.0 h767d61c_4
  + C libgcc-ng                15.1.0 h69a702a_4
  + C libgfortran              15.1.0 h69a702a_4
  + C libgfortran5             15.1.0 hcea5267_4
  + C libgomp                  15.1.0 h767d61c_4
  + C libjpeg-turbo            3.1.0 hb9d3cd8_0
  + C liblapack                3.9.0 34_h7ac8fdf_openblas
  + C liblzma                  5.8.1 hb9d3cd8_2
  + C libnsl                   2.0.1 hb9d3cd8_1
  + C libopenblas              0.3.30 pthreads_h94d23a6_2
  + C libpng                   1.6.50 h421ea60_1
  + C libsqlite                3.50.4 h0c1763c_0
  + C libstdcxx                15.1.0 h8f9b012_4
  + C libstdcxx-ng             13.2.0 hc0a3c3a_7
  + C libtiff                  4.7.0 h8261f1e_6
  + C libuuid                  2.38.1 h0b41bf4_0
  + C libwebp-base             1.6.0 hd42ef1d_0
  + C libxcb                   1.17.0 h8a09558_0
  + C libxcrypt                4.4.36 hd590300_1
  + C libzlib                  1.3.1 hb9d3cd8_2
  + C matplotlib-base          3.10.5 py312he3d6523_0
  + C matplotlib-inline        0.1.7 pyhd8ed1ab_1
  + C more-itertools           10.7.0 pyhd8ed1ab_0
  + C mpc                      1.3.1 h24ddda3_1
  + C mpfr                     4.2.1 h90cbb55_3
  + C mpmath                   1.3.0 pyhd8ed1ab_1
  + C munkres                  1.1.4 pyhd8ed1ab_1
  + C ncurses                  6.5 h2d0b736_3
  + C numpy                    2.3.2 py312h33ff503_0
  + C openjpeg                 2.5.3 h55fea9a_1
  + C openssl                  3.5.2 h26f9b46_0
  + C packaging                25.0 pyh29332c3_1
  + C parso                    0.8.4 pyhd8ed1ab_1
  + C pexpect                  4.9.0 pyhd8ed1ab_1
  + C pickleshare              0.7.5 pyhd8ed1ab_1004
  + C pillow                   11.3.0 py312h80c1187_0
  + C prompt-toolkit           3.0.51 pyha770c72_0
  + C pthread-stubs            0.4 hb9d3cd8_1002
  + C ptyprocess               0.7.0 pyhd8ed1ab_1
  + C pure_eval                0.2.3 pyhd8ed1ab_1
  + C pygments                 2.19.2 pyhd8ed1ab_0
  + C pyparsing                3.2.3 pyhe01879c_2
  + C python                   3.12.11 h9e4cc4f_0_cpython
  + C python-dateutil          2.9.0.post0 pyhe01879c_2
  + C python_abi               3.12 8_cp312
  + C qhull                    2020.2 h434a139_5
  + C readline                 8.2 h8c095d6_2
  + C six                      1.17.0 pyhe01879c_1
  + C stack_data               0.6.3 pyhd8ed1ab_1
  + C sympy                    1.14.0 pyh2585a3b_105
  + C tk                       8.6.13 noxft_hd72426e_102
  + C tomli-w                  1.2.0 pyhd8ed1ab_0
  + C tqdm                     4.67.1 pyhd8ed1ab_1
  + C traitlets                5.14.3 pyhd8ed1ab_1
  + C typing_extensions        4.14.1 pyhe01879c_0
  + C tzdata                   2025b h78e105d_0
  + C unicodedata2             16.0.0 py312h66e93f0_0
  + C unyt                     3.0.4 pyhd8ed1ab_0
  + C wcwidth                  0.2.13 pyhd8ed1ab_1
  + C widgetsnbextension       4.0.14 pyhd8ed1ab_0
  + C xorg-libxau              1.0.12 hb9d3cd8_0
  + C xorg-libxdmcp            1.1.5 hb9d3cd8_0
  + C yt                       4.4.1 py312hf79963d_0
  + C zstd                     1.5.7 hb8e6e7a_2

I am running on the Fugaku supercomputer.

I am currently using Python 3.12.11 and Julia 1.10.10.

I can import numpy without error, but not for matplotlib :frowning:

julia> pyimport("numpy")
Python: <module 'numpy' from '/home/.julia/environments/v1.10/.CondaPkg/.pixi/envs/default/lib/python3.12/site-packages/numpy/__init__.py'>

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)
Python stacktrace:
 [1] <module>
   @ ~/.julia/environments/v1.10/.CondaPkg/.pixi/envs/default/lib/python3.12/site-packages/matplotlib/cbook.py:32
 [2] <module>
   @ ~/.julia/environments/v1.10/.CondaPkg/.pixi/envs/default/lib/python3.12/site-packages/matplotlib/__init__.py:161
Stacktrace:
 [1] pythrow()
   @ PythonCall.Core ~/.julia/packages/PythonCall/avYrV/src/Core/err.jl:89
 [2] errcheck
   @ ~/.julia/packages/PythonCall/avYrV/src/Core/err.jl:10 [inlined]
 [3] pyimport(m::String)
   @ PythonCall.Core ~/.julia/packages/PythonCall/avYrV/src/Core/builtins.jl:1560
 [4] top-level scope
   @ REPL[4]:1

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…

Finally I tried to revert matplotlib’s version to 3.10.0, and now I can successfully pyimport("matplotlib").

I still don’t know why I can import matplotlib@3.10.5 in Python but cannot in Julia. Maybe because I am running on an old system🤔

2 Likes

EDIT: I think I read wrong (not sure why worked for me, not you): That’s a different kind or error, …

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?

CondaPkg.add("libstdcxx", version="<14.0")
2 Likes

Yeah it works! Thank you!

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.

1 Like

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).

Great! I’ll add this fix into CondaPkg so you won’t need this workaround in the future.

The libstdcxx meta-package is only a year old, which is why CondaPkg missed it. I only discovered it via this thread.

2 Likes

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 : )

1 Like

Here are the relevant issues on GitHub if you’d like to track them.

1 Like

Will this also fix the issue with PyCall, or do we need a extra issue for that?