10

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

2
  • 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
    Commented Jul 31, 2022 at 21:46
  • I've added a comprehensive answer to a similar problem here: stackoverflow.com/a/77940023/859591
    – lumbric
    Commented Feb 14 at 10:06

4 Answers 4

16

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
1
  • 2
    A more general solution is ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6 ${CONDA_PREFIX}/lib/libstdc++.so.6 Commented May 9 at 2:26
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
1
  • This worked for v2.0.1 building from source: ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6 ${CONDA_PREFIX}/lib Commented Aug 9, 2023 at 17:55
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.

0

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

conda install cmake
2
  • 4
    This made no difference for me, and I have no idea why it would.
    – ijt
    Commented May 22, 2023 at 2:22
  • Neither for me.
    – a06e
    Commented Jun 1, 2023 at 21:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .