Link statically to libstdc++ with -static-libstdc++ gcc option.
Link statically to libstdc++ with -static-libstdc++ gcc option.
I fixed this issue by installing: sudo apt-get install libstdc++6
In my case, I ran into this issue after installing MongoDB 3.0.1
mongo: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.18' not found (required by mongo)
Here's a solution for this problem in Ubuntu 16.04
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.9
sudo apt-get upgrade libstdc++6
You can check if you get GLIBCXX desired version like this:
strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX
I solved problem like this (but GLIBCXX_3.4.21 on CentOS) but it is not dependent from os. The library is part of gcc compiler so need to install or compile appropriate version of gcc. This is table of versions of gcc and versions of appropriate libstdc++:
GCC 4.9.0: libstdc++.so.6.0.20 GCC 5.1.0: libstdc++.so.6.0.21 GCC 6.1.0: libstdc++.so.6.0.22 GCC 7.1.0: libstdc++.so.6.0.23 GCC 7.2.0: libstdc++.so.6.0.24 GCC 8.0.0: libstdc++.so.6.0.25
( full list of versions is here )
It is not dependent from how to install gcc - it may be installed from package or compiled and installed from sources.
It is possible that system gcc libraries is available instead of newely installed. So need to specify environment variable where to find libraries for example in command line like this:
$ LD_LIBRARY_PATH=/usr/local/lib64 command args ...
Libstdc++.so.6: version `GLIBCXX_3.4.30' not found and sovled - Troubleshooting - Apache TVM Discuss
ImportError: `GLIBCXX_3.4.30' not found
How to manually select the libstdc++ library to use to resolve a "version 'GLIBCXX_#.#.##' not found" error?
'GLIBCXX_3.4.30' not found
I got a very similar issue, and solved it by linking the the lib file into the conda environment. For your situation you may try something like this:
ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /home/anavani/anaconda3/envs/dmcgb/bin/../lib/libstdc++.so.6
I also meet with the similar problem, with the answer by Jason, I use "ln" command to solve it. Because I already had the GLIBCXX_3.4.30 in /usr/lib/x86_64-linux-gnu/libstdc++.so.6. Then link it with library used in cython. Scipy package usually appears this kind of problem.
ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6 $HOME/miniconda3/envs/myenv/lib/python3.8/site-packages/zmq/backend/cython/../../../../.././libstdc++.so.6
I have exhausted myself for hours trying to find a solution to this. I am completely new to Linux and very inexperienced with operating systems back-end in general. I am trying to import librosa, but I am thrown with this error:
/home/lakshya/anaconda3/envs/tff_env/lib/python3.9/site-packages/zmq/backend/cython/../../../../.././libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /home/lakshya/anaconda3/envs/tff_env/lib/python3.9/site-packages/scipy/fft/_pocketfft/pypocketfft.cpython-39-x86_64-linux-gnu.so)
I tried the following to fix it based on the other similar questions that I browsed through:
-
sudo apt-get install libstdc++6
It's output: libstdc++6 is already the newest version (10.2.1-6) -
sudo apt-get dist-upgrade
It's output: 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. -
strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX
It's output: GLIBCXX version up to GLIBCXX_3.4.28 -
conda install libgccin my virtual env "tff_env"
It's output: libgcc-7.2.0 installed in tff_env -
Pip installed the libgcc package in the virtual environment as well. Didn't work.
What can I do?
My OS: Debian GNU/Linux 11 (bullseye)
Just been tackling a similar problem, it looks like you need to ensure you have the latest version of gcc. Running:
conda install -c conda-forge gcc=12.1.0
Fixed the error for me.
After my search on anaconda packages, I found only the package "libstdcxx" will substantially bring new "libstdc++.so.6" file to the conda environment (while "gcc", "gcc_linux-64", and "libgcc-ng" cannot). Thus, installing the following package can fix this problem for me.
conda install -c conda-forge libstdcxx-ng=12
PS: dfcorbin's answer conda install -c conda-forge gcc=12 not works for me.