简体   繁体   English

/usr/lib/x86_64-linux-gnu/libstdc++.so.6: 找不到 TensorFlow 需要的版本“GLIBCXX_3.4.21”

[英]/usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.21' not found required by TensorFlow

I'm trying to deploy a flask app on a debian server using Machine Learning libs, i managed that so far with most ML libraries but i got this error thanks to TensorFlow which i researched a lot about it with no working solution for me.我正在尝试使用机器学习库在debian服务器上部署一个Flask应用程序,到目前为止我使用大多数 ML 库进行了管理,但是由于TensorFlow ,我得到了这个错误,我对它进行了大量研究,但没有对我有用的解决方案。

PS : I'm using a 3.7 python venv for my app PS:我正在为我的应用程序使用 3.7 python venv

ImportError: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /flask/wstest/lib/python3.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so) Mar 01 15:32:11 django gunicorn[8803]: Failed to load the native TensorFlow runtime.导入错误:/usr/lib/x86_64-linux-gnu/libstdc++.so.6:未找到版本“GLIBCXX_3.4.21”(/flask/wstest/lib/python3.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal 需要) .so) Mar 01 15:32:11 django gunicorn[8803]:无法加载本机 TensorFlow 运行时。

I'm clearly missing the GLIBCXX 3.4.21 because strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX我清楚地错过了GLIBCXX 3.4.21因为strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX shows 3.4.20 as the latest version. strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX显示3.4.20作为最新版本。

Tried this fix add-apt-repository ppa:ubuntu-toolchain-r/test Gives this : result of the toolchain add attempt尝试了这个修复add-apt-repository ppa:ubuntu-toolchain-r/test给出了这个:工具链添加尝试的结果

Tried apt-get update, Got this尝试 apt-get 更新,得到这个

W: Failed to fetch http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu/dists/jessie/main/binary-amd64/Packages 404 Not Found W:无法获取http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu/dists/jessie/main/binary-amd64/Packages 404 Not Found

Also tried to update libgcc and libstdc++6, says i have the latest version.还尝试更新 libgcc 和 libstdc++6,说我有最新版本。

EDIT : I'm suspecting that Debian 8 Jessie doesn't support a higher glibcxx version than the 3.4.20.编辑:我怀疑 Debian 8 Jessie 不支持比 3.4.20 更高的 glibcxx 版本。

Here's a solution for this problem in Ubuntu 16.04这是 Ubuntu 16.04 中此问题的解决方案

sudo apt-get install software-properties-common
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

You can check if you get GLIBCXX desired version like this:您可以检查是否获得了 GLIBCXX 所需的版本,如下所示:

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

So, i just tested Stretch and it works fine.所以,我刚刚测试了Stretch ,它工作正常。 The issue is related to the OS in this case Debian 8 Jessie , it cannot handle a higher version of glibcxxx than the 3.4.20.在这种情况下,该问题与Debian 8 Jessie的操作系统有关,它无法处理比 3.4.20 更高版本的 glibcxxx。

PS : Stretch is Debian 9 's distribution name PSStretchDebian 9的发行版名称

If you're using Anaconda/Miniconda, you can also get your OS to use the libstdc++.so.6 provided with your installation by setting your LD_LIBRARY_PATH environment variable.如果您使用的是 Anaconda/Miniconda,您还可以通过设置LD_LIBRARY_PATH环境变量,让您的操作系统使用随安装提供的libstdc++.so.6 Say you have Miniconda installed in /home/whatever/miniconda3 and you're using bash .假设您在/home/whatever/miniconda3 miniconda3 中安装了/home/whatever/miniconda3并且您正在使用bash Then add this to your ~/.bashrc :然后将其添加到您的~/.bashrc

export LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu/:/home/whatever/miniconda3/lib

source ~/.bashrc or restart your shell and you should be good to go. source ~/.bashrc或重新启动你的shell,你应该很高兴。

See also: https://gcc.gnu.org/onlinedocs/libstdc++/faq.html#faq.how_to_set_paths and How to update libstdc++.so.6 or change the file to use on Tensorflow, Python .另请参阅: https : //gcc.gnu.org/onlinedocs/libstdc++/faq.html#faq.how_to_set_pathsHow to update libstdc++.so.6 or change the file to use on Tensorflow, Python

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Anaconda ImportError: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found - Anaconda ImportError: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found 获取 ImportError /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version 'CXXABI_1.3.11' not found - Getting ImportError /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version 'CXXABI_1.3.11' not found 导入错误:/usr/lib/aarch64-linux-gnu/libstdc++.so.6:找不到版本“GLIBCXX_3.4.30” - ImportError: /usr/lib/aarch64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.30' not found python3: /lib/x86_64-linux-gnu/libm.so.6: 找不到版本“GLIBC_2.29”(python3 需要) - python3: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by python3) /lib/x86_64-linux-gnu/libm.so.6:找不到版本“GLIBC_2.29”(/usr/local/lib/python3.7/dist-packages/pyexiv2/lib/libexiv2.so 需要)colab粘性物 - /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /usr/local/lib/python3.7/dist-packages/pyexiv2/lib/libexiv2.so) colab goo R 网状 libstdc++so GLIBCXX_3.4.21 未找到问题 - R reticulate libstdc++so GLIBCXX_3.4.21 not found issue Python3:导入错误:/lib/x86_64-linux-gnu/libQt5Core.so.5:未找到版本“Qt_5.15” - Python3: ImportError: /lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.15' not found 加载 Python lib '/tmp/_MEItueAuk/libpython3.7m.so.1.0' 时出错:dlopen: /lib/x86_64-linux-gnu/libc.so.6: 找不到版本 'GLIBC_2.28' - Error loading Python lib '/tmp/_MEItueAuk/libpython3.7m.so.1.0': dlopen: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found 运行 python azure 函数应用程序时遇到错误:ImportError: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found - Facing error while running python azure function app: ImportError: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found Python在ldconfig -p确实找到的/ usr / lib / x86_64-linux-gnu中找不到库 - Python not finding library in /usr/lib/x86_64-linux-gnu that ldconfig -p does find
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM