tensorflow import error with gcc version upgrade

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/selfimpro_001/article/details/90486072

There are mistakes in the import tensorflow

ImportError: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /root/anaconda3/lib/python3.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so)

Cause Analysis

The main reason is lower gcc version at centOS environment
Here Insert Picture Description
and python3.7 version of gcc high
Here Insert Picture Description
so you need to upgrade to GCC version 7.2.0:

GCC upgrade method is as follows:

(Offline upgrade method: https://blog.csdn.net/weixin_39704301/article/details/78448349)

# 下载GCC 7.2.0的压缩包
# GCC资源地址:http://ftp.gnu.org/gnu/gcc/
# GCC7.2.0下载地址:gcc-7.2.0.tar.gz
wget http://ftp.gnu.org/gnu/gcc/gcc-7.2.0/gcc-7.2.0.tar.gz
#在下载资源文件目录上解压压缩包
tar -zxvf gcc-7.2.0.tar.gz
# 进入解压文件目录,执行download_prerequisites 脚本下载、配置、安装依赖库
cd gcc-7.2.0
./contrib/download_prerequisites
# 在当前目录下,创建一个目录存放编译出的文件
mkdir gcc-build-7.2.0
cd gcc-build-7.2.0
# 生成Makefile文件
../configure -enable-checking=release -enable-languages=c,c++ -disable-multilib
# 执行make
yum groupinstall "Development Tools"
make   ## make 过程较长,可使用nohup make & 命令
#安装gcc7.2.0
make install
# 完成后,测试
shutdown -r now //请先重启,切记!
gcc -v
g++ -v

update successed:
Here Insert Picture Description

The fundamental problem has not been resolved ah, pit, continue to find reasons

https://github.com/tensorflow/tensorflow/issues/26378
https://blog.csdn.net/u010379814/article/details/79723309

Guess you like

Origin blog.csdn.net/selfimpro_001/article/details/90486072