"/lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found
The python is installed via Conda.jl, but
using PyCall
@pyimport matplotlib.pyplot as plt
calles system's libstdc++.so.6 and fails
julia> @pyimport matplotlib.pyplot as plt
ERROR: PyError (ccall(@pysym(:PyImport_ImportModule), PyPtr, (Cstring,), name)
The Python package matplotlib.pyplot could not be found by pyimport. Usually this means
that you did not install matplotlib.pyplot in the Python version being used by PyCall.
PyCall is currently configured to use the Julia-specific Python distribution
installed by the Conda.jl package. To install the matplotlib.pyplot module, you can
use `pyimport_conda("matplotlib.pyplot", PKG)`, where PKG is the Anaconda
package the contains the module matplotlib.pyplot, or alternatively you can use the
Conda package directly (via `using Conda` followed by `Conda.add` etcetera).
Alternatively, if you want to use a different Python distribution on your
system, 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 PyCall
documentation, set ENV["PYTHON"] to the path/name of the python executable
you want to use, run Pkg.build("PyCall"), and re-launch Julia.
) <type 'exceptions.ImportError'>
ImportError("/lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by ~/.julia/v0.6/Conda/deps/usr/lib/python2.7/site-packages/matplotlib/_path.so)",)
The problem can be solved by telling the system explicitly to use libstdc++.so.6 from the Conda setup. One does it by
export LD_LIBRARY_PATH=$HOME/.julia/v0.6/Conda/deps/usr/lib/:$LD_LIBRARY_PATH
Then, everything works.
At least two problems
- The solution is not good, I would prefer Conda setting LD_LYBRARY_PATH by itself
- The printed message seems to be misleading.
One problem here is that Julia itself is linked to libstdc++, so that is probably why /lib64/libstdc++.so.6 is being loaded on startup.
If you are on Linux, I would generally recommend using the system Python rather than Conda.jl to reduce the chance of library conflicts.
Note that the Conda.jl package cannot affect how Julia is started, so it can't automatically change the libstdc++ library loaded at Julia startup.
And the error message is from PyPlot.jl, not from Conda.jl.
Thank you for the quick reply.
Do you know where else libstdc++.so.6 is used? The library sounds very important.
What else in Julia can be affected by absent of CXXABI_1.3.9 in the libstdc++.so.6?
It is very convenient to use Julia-specific python installation. Do you see the way to tell python calls to use libstdc++ from the Conda environment and the rest to stay with system one?
I also had problems with the system python for PyPlot (might be the similar problems). I can check later.
LLVM is a C++ library used within Julia, and hence Julia needs to link to a C++ standard library. The issue here is that Conda apparently wants a newer version of this library than the one in /usr/lib that Julia is linked to.
I thought that using the older version of matplotlib should also be a solution.
I found that matplotlib=v2.0.1 the last one which does require CXXABI_1.3.9.
Unfortunately, it does not mean that it works.
julia> @pyimport matplotlib.pyplot as plt
ERROR: PyError (ccall(@pysym(:PyImport_ImportModule), PyPtr, (Cstring,), name)
The Python package matplotlib.pyplot could not be found by pyimport. Usually this means
that you did not install matplotlib.pyplot in the Python version being used by PyCall.
PyCall is currently configured to use the Julia-specific Python distribution
installed by the Conda.jl package. To install the matplotlib.pyplot module, you can
use `pyimport_conda("matplotlib.pyplot", PKG)`, where PKG is the Anaconda
package the contains the module matplotlib.pyplot, or alternatively you can use the
Conda package directly (via `using Conda` followed by `Conda.add` etcetera).
Alternatively, if you want to use a different Python distribution on your
system, 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 PyCall
documentation, set ENV["PYTHON"] to the path/name of the python executable
you want to use, run Pkg.build("PyCall"), and re-launch Julia.
) <type 'exceptions.ImportError'>
ImportError("/lib64/libz.so.1: version `ZLIB_1.2.9' not found (required by ${HOME}/.julia/v0.6/Conda/deps/usr/lib/python2.7/site-packages/matplotlib/../../../libpng16.so.16)",)
File "${HOME}/.julia/v0.6/Conda/deps/usr/lib/python2.7/site-packages/matplotlib/pyplot.py", line 29, in <module>
my system libz.so containts the latest ZLIB_1.2.5.2
$ strings /lib64/libz.so.1 | grep ZLIB_
ZLIB_1.2.0
ZLIB_1.2.0.2
ZLIB_1.2.0.8
ZLIB_1.2.2
ZLIB_1.2.2.3
ZLIB_1.2.2.4
ZLIB_1.2.3.3
ZLIB_1.2.3.4
ZLIB_1.2.3.5
ZLIB_1.2.5.1
ZLIB_1.2.5.2
Do you see options except of the recompiling julia with the conda envirement?
The ZLIB issue is JuliaPy/PyPlot.jl#151, which is now fixed with Julia 0.6.3.
Thank you for fixing ZLIB!
Just for curiosity, I repeated the same exercise as before with getting old mathplotlib=2.01 downgrading few packages in conda and trying to use PyPlot. The ZLIB error did not appear!
using Conda
Conda.install("matplotlib=2.01")
Pkg.build("PyPlot")
using PyPlot
Nevertheless, then, it threw the Segmentation fault
signal (11): Segmentation fault
while loading no file, in expression starting on line 0
unknown function (ip: 0x7f530827e63f)
unknown function (ip: 0x7f52e5ee704f)
Allocations: 20640065 (Pool: 20637263; Big: 2802); GC: 46
Segmentation fault (core dumped)
Probably it means that some methods are called which were not in the old version..