10

I'm using Anaconda 4.10.3, with Python 3.9.7, Scipy 1.7.1 on Ubuntu 16.04.6. A script I need to run uses Scipy's optimize and it throws the following error:

ImportError: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version 'GLIBCXX_3.4.26' not found (required by /home/user/anaconda3/envs/work/lib/python3.9/site-packages/scipy/optimize/_group_columns.cpython-39-x86_64-linux-gnu.so)

As indicated in the error, the system libstcc++.so.6 does not provide GLIBCXX_3.4.26, which I verified using

strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX

Then I ran conda install libgcc and verified that strings /home/user/anaconda3/envs/work/lib/libstdc++.so.6.0.29 | grep GLIBCXX shows GLIBCXX_3.4.26. I then added the following line to my .bashrc and ran source ~/.bashrc

LD_LIBRARY_PATH=/home/user/anaconda3/envs/work/lib/:$LD_LIBRARY_PATH

When I run the script after this, I still get the same error saying ImportError: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version 'GLIBCXX_3.4.26' not found.

I was thinking of downgrading scipy, but shouldn't there be a better way to fix this without downgrading?

vpk
  • 1,240
  • 2
  • 18
  • 32

1 Answers1

4

I am having the same issue crop up using Anaconda3 (4.10.3), Python 3.7.12, and Scipy 1.7.3. Changing my PATH and LD_LIBRARY_PATH in my .bashrc did not fix the issue.

After some searching, it seems to be a conda dependency issue: Anaconda libstdc++.so.6: version `GLIBCXX_3.4.20' not found

I was able to fix the issue by running conda update libstdcxx-ng