JuliaPy / PyPlot.jl

Plotting for Julia based on matplotlib.pyplot
https://github.com/JuliaPy/PyPlot.jl
MIT License
475 stars 87 forks source link

libstdc++.so.6: version `GLIBCXX_3.4.26' not found #469

Closed dav2017 closed 4 years ago

dav2017 commented 4 years ago

Recently, using PyPlot resulted in the following error:

ERROR: InitError: PyError (PyImport_ImportModule

The Python package matplotlib could not be found by pyimport. Usually this means
that you did not install matplotlib in the Python version being used by PyCall.
[...]
ImportError("/usr/local/julia-1.4.0/bin/../lib/julia/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /usr/lib/python3.8/site-packages/matplotlib/ft2font.cpython-38-x86_64-linux-gnu.so)")

My system: Manjaro Linux Julia version: both 1.3.1 and 1.4.0

It turns out to be the same error described here on discourse and temporarily solved in the same way. libstdc++ coming with Julia is outdated compared to the system one. A workaround is to copy (or link) the system libstdc++.so.6 to the Julia folder: cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 $JULIA_HOME/lib/julia/

stevengj commented 4 years ago

You can also use LD_PRELOAD when you launch Julia, probably.

But I don't think this is fixable in PyPlot — by the time PyPlot is loaded, Julia has already loaded its C++ library. So we have to wait for JuliaLang/julia#34276 to be fixed.

mvanzulli commented 2 years ago

Recently, using PyPlot resulted in the following error:

ERROR: InitError: PyError (PyImport_ImportModule

The Python package matplotlib could not be found by pyimport. Usually this means
that you did not install matplotlib in the Python version being used by PyCall.
[...]
ImportError("/usr/local/julia-1.4.0/bin/../lib/julia/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /usr/lib/python3.8/site-packages/matplotlib/ft2font.cpython-38-x86_64-linux-gnu.so)")

My system: Manjaro Linux Julia version: both 1.3.1 and 1.4.0

It turns out to be the same error described here on discourse and temporarily solved in the same way. libstdc++ coming with Julia is outdated compared to the system one. A workaround is to copy (or link) the system libstdc++.so.6 to the Julia folder: cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 $JULIA_HOME/lib/julia/

This worked perfect for me using Manjaro unstable servers and julia-bin from arch. THX :100:

volkerkarle commented 1 year ago

I have the same problem and I also created a symlink to libstdc++.so.6 like described above to fix it. However, that is not a long-term solution!

libstdc++.so.6: versionGLIBCXX_3.4.30' not found`

dav2017 commented 1 year ago

On my system the library is now: /usr/lib/libstdc++.so.6.0.30

so I create these links in /path/to/julia-1.8.3/lib/julia:

libstdc++.so -> /usr/lib/libstdc++.so.6.0.30
libstdc++.so.6 -> /usr/lib/libstdc++.so.6.0.30
libstdc++.so.6.0.30 -> /usr/lib/libstdc++.so.6.0.30

The problem should be definitely solved in julia-1.9: https://github.com/JuliaLang/julia/blob/v1.9.0-alpha1/NEWS.md#external-dependencies