Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libstdc++.so.6: version `GLIBCXX_3.4.22' not found #13

Closed
leeeexp opened this issue May 21, 2018 · 25 comments
Closed

libstdc++.so.6: version `GLIBCXX_3.4.22' not found #13

leeeexp opened this issue May 21, 2018 · 25 comments

Comments

@leeeexp
Copy link

leeeexp commented May 21, 2018

Hi,
This is a great project. When I install it in my pi 3B and import tensorflow,there had a importerror:ImportError: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /usr/local/lib/python2.7/dist-packages/tensorflow/python/_pywrap_tensorflow_internal.so)

@lhelontra
Copy link
Owner

Hi, you're needs upgrade libstd.

apt-get update
apt-get install libstdc++6

@wette
Copy link

wette commented Jun 25, 2018

to use the correct version of libstdc++, you can copy over the libraries you linked against to the target machine.

On the machine that you used to compile tensorflow, copy over all files
tensorflow-on-arm/build_tensorflow/sources/toolchain/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/lib/libstdc++* to a directory on your target machine (say to /opt/myLibs/).
Then, point the variable LD_LIBRARY_PATH to that directory before you execute tensorflow.
export LD_LIBRARY_PATH=/opt/myLibs
python3 my_script.py
The system will then try to find libstdc++6 first in the directory /opt/myLibs before looking in other parts of your system.

@ashish-koranja
Copy link

I ran into the same issue while installing tensorflow 1.8.0 on Ubuntu-Mate 1604. libstdc++6 package had already been update to its latest version.

I tried the command strings on /usr/lib/arm-linux-gnueabihf/libstdc++.so.6

$ strings /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 | grep GLIBCXX
GLIBCXX_3.4
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_DEBUG_MESSAGE_LENGTH

The following instructions helped me upgrade libstdc++6 :
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get upgrade

@mwycliff
Copy link

mwycliff commented Sep 3, 2018

I originally encountered this error message after trying to run Matrix Laboratory from the terminal command prompt. I encountered a thread on Matlab answers that helped fix the problem. This may or may not apply in your particular situation, but it is worth giving this a try. I posted a link to the original discussion thread at the bottom.


Try these commands, you need to upgrade your libstdc++6 version. If first command can't run, just run other three. I hope it can help you.

%code
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


https://www.mathworks.com/matlabcentral/answers/389024-why-does-matlab-r2018a-display-erroneous-message-on-ubuntu-16-04?s_tid=answers_rc1-2_p2_MLT

@csukuangfj
Copy link

@wette
thank you! Your suggestion works perfectly!

@zhaorong1029
Copy link

thanks very much

@detectRecog
Copy link

detectRecog commented May 4, 2019

libstdc++6

Hi, guys, just use this command to upgrade libstdc++6 is enough:
sudo apt-get install --only-upgrade libstdc++6
rather than
sudo apt-get upgrade libstdc++6
The latter one will upgrade all packages, which needs a long time

In summary:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.9
sudo apt-get install --only-upgrade libstdc++6

@lustre-japang
Copy link

lustre-japang commented Jun 18, 2019

@detectRecog your suggestion works for me, thanks

@wuxiangli91
Copy link

@detectRecog thank u so much, it works fine for me

@yhetman
Copy link

yhetman commented Aug 21, 2020

I originally encountered this error message after trying to run Matrix Laboratory from the terminal command prompt. I encountered a thread on Matlab answers that helped fix the problem. This may or may not apply in your particular situation, but it is worth giving this a try. I posted a link to the original discussion thread at the bottom.

Try these commands, you need to upgrade your libstdc++6 version. If first command can't run, just run other three. I hope it can help you.

%code
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

https://www.mathworks.com/matlabcentral/answers/389024-why-does-matlab-r2018a-display-erroneous-message-on-ubuntu-16-04?s_tid=answers_rc1-2_p2_MLT

@mwycliff
Thanks a lot, it helped me

@jung-seon
Copy link

Install libstdc++-6-dev

@davidalmarinho
Copy link

I originally encountered this error message after trying to run Matrix Laboratory from the terminal command prompt. I encountered a thread on Matlab answers that helped fix the problem. This may or may not apply in your particular situation, but it is worth giving this a try. I posted a link to the original discussion thread at the bottom.

Try these commands, you need to upgrade your libstdc++6 version. If first command can't run, just run other three. I hope it can help you.

%code
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

https://www.mathworks.com/matlabcentral/answers/389024-why-does-matlab-r2018a-display-erroneous-message-on-ubuntu-16-04?s_tid=answers_rc1-2_p2_MLT

I have really to thank you!!! I lost some hours trying to get a solution and you gave me it. One more time thank you :D

@darvincy
Copy link

darvincy commented Jul 29, 2021

上述的办法好像有的404了,根据这个博客,进行替换更高版本的libstdc++.so.6即可,我选的是libstdc++.so.6.0.26解决了,这问题太折磨人了
https://blog.csdn.net/SweetSeven_/article/details/110186738

@sportzhang
Copy link

libstdc++6

Hi, guys, just use this command to upgrade libstdc++6 is enough: sudo apt-get install --only-upgrade libstdc++6 rather than sudo apt-get upgrade libstdc++6 The latter one will upgrade all packages, which needs a long time

In summary: sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt-get install gcc-4.9 sudo apt-get install --only-upgrade libstdc++6

this works for me, thank you so much

@RuaConIT
Copy link

libstdc++6

Hi, guys, just use this command to upgrade libstdc++6 is enough: sudo apt-get install --only-upgrade libstdc++6 rather than sudo apt-get upgrade libstdc++6 The latter one will upgrade all packages, which needs a long time

In summary: sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt-get install gcc-4.9 sudo apt-get install --only-upgrade libstdc++6

It's worked for me, thank you so much!!

@withtimesgo1115
Copy link

上述的办法好像有的404了,根据这个博客,进行替换更高版本的libstdc++.so.6即可,我选的是libstdc++.so.6.0.26解决了,这问题太折磨人了 https://blog.csdn.net/SweetSeven_/article/details/110186738

请用英语交流
Please use English to communicate here

@aro-n
Copy link

aro-n commented Jan 13, 2023

I'm using Debian 11 and trying to import a KerasClassifiier
What worked for me was only:
sudo apt-get upgrade libstdc++6

@vivuu1989
Copy link

We are using redhat 7.9 version and getting same error /lib64/libstdc++.so.6: version 'GLIBCXX_3.4.22' not found.

But here we don't have internet to update the version. Any guidance if we can upgrade this one offline

@Letter-R
Copy link

I use "conda install -c conda-forge gcc=12.1.0" fix 'GLIBCXX_3.4.30' not found error

@shaochengluo
Copy link

It was the last line that really worked:

sudo apt-get upgrade libstdc++6

It worked for my error: ImportError: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found

@saifhassan-phd
Copy link

sudo apt-get install --only-upgrade libstdc++6

this worked, thanks

@addisonklinke
Copy link

addisonklinke commented Jan 17, 2024

The general consensus works for me

sudo apt-get install software-properties-common  # If add-apt-repository is missing
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get upgrade libstdc++6

Can anyone explain WHY this external repository and upgrade are needed? If I already have libstdc++6 installed, why does upgrading change the output of strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX, and how can I control the upgrade to target a particular GLIBCXX version string?

I would expect libstdc++.so.6 to have a consistent set of symbols, so it would make more sense to me if I had to install a new libstdc++.so.7x to get the missing GLIBCXX, but instead the solution is just to update .so.6

@xumeng
Copy link

xumeng commented Mar 17, 2024

https://stackoverflow.com/questions/44205687/glibcxx-3-4-21-not-found-on-centos-7/78175490#78175490
I had the same problem in CentOS 7.x, and then solved it like this answer.
I hope it can be helpful for others.

@BJHYZJ
Copy link

BJHYZJ commented May 20, 2024

I use "conda install -c conda-forge gcc=12.1.0" fix 'GLIBCXX_3.4.30' not found error

I meet problem in Ubuntu22 for runing import rclpy,and solve this using above function.

@MahrukhAliKhan
Copy link

I originally encountered this error message after trying to run Matrix Laboratory from the terminal command prompt. I encountered a thread on Matlab answers that helped fix the problem. This may or may not apply in your particular situation, but it is worth giving this a try. I posted a link to the original discussion thread at the bottom.
Try these commands, you need to upgrade your libstdc++6 version. If first command can't run, just run other three. I hope it can help you.
%code
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
https://www.mathworks.com/matlabcentral/answers/389024-why-does-matlab-r2018a-display-erroneous-message-on-ubuntu-16-04?s_tid=answers_rc1-2_p2_MLT

@mwycliff Thanks a lot, it helped me

I have tried this solution. But it doesn't work for me. Kindly help me.
Screenshot from 2024-11-21 16-05-12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests