How to install PyPlot on a server

When trying to install PyPlot on DelftBlue, the supercomputer of TU Delft, running on Red Hat Enterprise Linux 8, I get the following error:

ImportError("/home/uwefechner/.julia/juliaup/julia-1.11.6+0.x64.linux.gnu/bin/../lib/julia/libstdc++.so.6: version `CXXABI_1.3.15' not found (required by /home/uwefechner/.julia/conda/3/x86_64/lib/python3.12/site-packages/matplotlib/_c_internal_utils.cpython-312-x86_64-linux-gnu.so)")

What could be the reason?

To reproduce the error, run the following Bash script:

module load 2023r1
export PYTHON=""
export PYTHON_EXEC=""
export PYTHON_PATH=""
rm -rf ~/.julia/conda
julia -e 'using Pkg; Pkg.add("PyPlot"); Pkg.build("PyPlot")'
julia -e 'using PyPlot'

Further info:

julia> versioninfo()
Julia Version 1.11.6
Commit 9615af0f269 (2025-07-09 12:58 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 32 × Intel(R) Xeon(R) Gold 6226R CPU @ 2.90GHz
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, cascadelake)
Threads: 1 default, 0 interactive, 1 GC (on 32 virtual cores)
Environment:
  LD_LIBRARY_PATH = /cm/shared/apps/slurm/current/lib64

I don’t know if this is related, but can you try

export LD_LIBRARY_PATH=.
1 Like

I tried your suggestion:

module load 2023r1
export PYTHON=“”
export PYTHON_EXEC=“”
export PYTHON_PATH=“”
echo “Deleting .julia/conda …”
rm -rf ~/.julia/conda
export LD_LIBRARY_PATH=.
echo “Installing and building PyPlot…”
julia -e ‘using Pkg; Pkg.add(“PyPlot”); Pkg.build(“PyPlot”)’
echo “Using PyPlot…”
julia -e ‘using PyPlot’

Still the same error:

PyCall is currently configured to use the Julia-specific Python distributioninstalled by the Conda.jl package. To install the matplotlib module, you canuse pyimport_conda(“matplotlib”, PKG), where PKG is the Anacondapackage that contains the module matplotlib, or alternatively you can use theConda package directly (via using Conda followed by Conda.add etcetera).

Alternatively, if you want to use a different Python distribution on yoursystem, such as a system-wide Python (as opposed to the Julia-specific Python),you can re-configure PyCall with that Python. As explained in the PyCalldocumentation, set ENV[“PYTHON”] to the path/name of the python executableyou want to use, run Pkg.build(“PyCall”), and re-launch Julia.

) <class ‘ImportError’>ImportError(“/home/uwefechner/.julia/juliaup/julia-1.11.6+0.x64.linux.gnu/bin/../lib/julia/libstdc++.so.6: version CXXABI_1.3.15’ not found (required by /home/uwefechner/.julia/conda/3/x86_64/lib/python3.12/site-packages/matplotlib/_c_internal_utils.cpython-312-x86_64-linux-gnu.so)”)File “/home/uwefechner/.julia/conda/3/x86_64/lib/python3.12/site-packages/matplotlib/init.py”, line 161, in from . import _api, _version, cbook, _docstring, rcsetupFile “/home/uwefechner/.julia/conda/3/x86_64/lib/python3.12/site-packages/matplotlib/cbook.py”, line 32, in from matplotlib import _api, _c_internal_utils

UPDATE:
Some progress:
[uwefechner@login02 ~]$ find ~ -name ‘libstdc++.so.6’ 2>/dev/null
/home/uwefechner/.julia/juliaup/julia-1.11.6+0.x64.linux.gnu/lib/julia/libstdc++.so.6
/home/uwefechner/.julia/conda/3/x86_64/lib/libstdc++.so.6
/home/uwefechner/.julia/conda/3/x86_64/pkgs/libstdcxx-15.1.0-h8f9b012_3/lib/libstdc++.so.6

This works:

[uwefechner@login03 ~]$ cat install_pyplot 
module load 2023r1
export PYTHON=""
export PYTHON_EXEC=""
export PYTHON_PATH=""
export LD_LIBRARY_PATH=~/.julia/conda/3/x86_64/lib:~/.julia/juliaup/julia-1.11.6+0.x64.linux.gnu/lib/julia
echo "Deleting ~/.julia/conda..."
rm -rf ~/.julia/conda
echo "Installing PyPlot..."
julia -e 'ENV["PYTHON"]=""; using Pkg; Pkg.add("PyPlot"); Pkg.build("PyPlot")'
echo "Using PyPlot"
julia -e 'using PyPlot'

And in my .bashrc file I have to do:

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