9

I am installing a package with pip in my conda environment and I keep getting this error:

ImportError: /home/anavani/anaconda3/envs/dmcgb/bin/../lib/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /lib/x86_64-linux-gnu/libLLVM-13.so.1)

I looked on previous stack overflow posts and found this and I followed what the top comment said to do and ran these commands:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

When I run strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX to check the latest version of GLIBCXX, I get this output:

GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_3.4.22
GLIBCXX_3.4.23
GLIBCXX_3.4.24
GLIBCXX_3.4.25
GLIBCXX_3.4.26
GLIBCXX_3.4.27
GLIBCXX_3.4.28
GLIBCXX_3.4.29
GLIBCXX_3.4.30

so I'm not sure what's wrong as GLIBCXX_3.4.30 is installed.

Any help would be appreciated. I am running Ubuntu 22.04 LTS

andrew.46
  • 38,003
  • 27
  • 156
  • 232
  • 1
    I don't know about your particular situation, but the strings command you give is just finding alphanum strings in a library file; if you want to know if the system sees that library look at ldd. Also, your error relates to a file beneath your home folder but that strings command is operating on a file in /usr/lib. – pbhj Jul 31 '22 at 21:46
  • I've added a comprehensive answer to a similar problem here: https://stackoverflow.com/a/77940023/859591 – lumbric Feb 14 '24 at 10:06

4 Answers4

12

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
Jason
  • 221
2

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
CaCaSun
  • 21
2

In my case, I got the similar problem:

ImportError: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29` not found (required by /home/<username>/miniconda3/envs/<env_name>/lib/python3.9/site-packages/google/protobuf/pyext/_message.cpython-39-x86_64-linux-gnu.so)

As can be seen in the error message, this error is due to miniconda3, so I added the following lib to LD_LIBRARY_PATH which works for me in some cases

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/<username>/miniconda3/lib

But there might be a more convenient way to solve this problem.

TommyPeanuts
  • 1,079
L17
  • 21
0

Had the same issue, seems that installing cmake via conda does the trick.

conda install cmake