How to update libstdc++.so.6 or change the file to use on Tensorflow, Python
Asked Answered
A

2

2

I am using Python3 and Tensorflow 1.15 on Apache server CentOS6.

Now, I am Struggling with this error.

It requires GLIBCXX_3.4.17

ImportError: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.17' not found (required by /home/app/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/_pywrap_tensorflow_internal.so)

So,Now I checked the libstdc version.

strings /usr/lib64/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_FORCE_NEW
GLIBCXX_DEBUG_MESSAGE_LENGTH

There is no 3.4.17

However in conda directory, there is another libstdc++ too

strings /home/app/anaconda3/lib/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_3.4.21
GLIBCXX_3.4.22
GLIBCXX_3.4.23
GLIBCXX_3.4.24
GLIBCXX_3.4.25
GLIBCXX_3.4.26
GLIBCXX_DEBUG_MESSAGE_LENGTH

So I have two ideas.

  1. update /usr/lib/64/libstdc++.so.6 on CentOS6

sudo yum update libstdc++-devel

no package found...

  1. force python to use /home/app/anaconda3/lib/libstdc++.so.6

However I have no idea how to ....

If you have any ideas, Please help..

Aerogram answered 26/1, 2020 at 18:7 Comment(0)
N
0

See https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dynamic_or_shared.html#manual.intro.using.linkage.dynamic which explains how to ensure a newer libstdc++.so.6 is found by the linker.

Also the libstdc++ FAQ at https://gcc.gnu.org/onlinedocs/libstdc++/faq.html#faq.how_to_set_paths

Namesake answered 5/2, 2020 at 14:12 Comment(0)
P
0

I had this same issue and setting the LD_LIBRARY_PATH to the /lib directory of the conda environment fixed the problem for me:

export LD_LIBRARY_PATH=/home/app/anaconda3/lib
Preemption answered 28/8, 2023 at 17:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.