【报错解决】ImportError: /lib64/libstdc++.so.6: version `CXXABI_1.3.8‘ not found

问题描述

安装paddle之后起不来,报错
Error: Can not import avx core while this file exists: /usr/local/lib64/python3.6/site-packages/paddle/fluid/core_avx.so
2022-06-21 11:33:48.310 Uncaught app exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/streamlit/scriptrunner/script_runner.py", line 554, in _run_script
    exec(code, module.__dict__)
  File "/data/bi/soft/magi_system/MagiSystemMain.py", line 21, in 
    from ProjectSetting import ProjectSetting
  File "/data/bi/soft/magi_system/ProjectSetting.py", line 4, in 
    from CE.CE import CE
  File "/data/bi/soft/magi_system/CE/CE.py", line 32, in 
    from paddlenlp import Taskflow
  File "/usr/local/lib/python3.6/site-packages/paddlenlp/__init__.py", line 24, in 
    from . import data
  File "/usr/local/lib/python3.6/site-packages/paddlenlp/data/__init__.py", line 15, in 
    from .collate import *
  File "/usr/local/lib/python3.6/site-packages/paddlenlp/data/collate.py", line 17, in 
    import paddle
  File "/usr/local/lib64/python3.6/site-packages/paddle/__init__.py", line 25, in 
    from .framework import monkey_patch_variable
  File "/usr/local/lib64/python3.6/site-packages/paddle/framework/__init__.py", line 17, in 
    from . import random  # noqa: F401
  File "/usr/local/lib64/python3.6/site-packages/paddle/framework/random.py", line 16, in 
    import paddle.fluid as fluid
  File "/usr/local/lib64/python3.6/site-packages/paddle/fluid/__init__.py", line 36, in 
    from . import framework
  File "/usr/local/lib64/python3.6/site-packages/paddle/fluid/framework.py", line 37, in 
    from . import core
  File "/usr/local/lib64/python3.6/site-packages/paddle/fluid/core.py", line 298, in 
    raise e
  File "/usr/local/lib64/python3.6/site-packages/paddle/fluid/core.py", line 256, in 
    from . import core_avx
ImportError: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/local/lib64/python3.6/site-packages/paddle/fluid/core_avx.so)

问题定位

搜到是/lib64/libstdc++.so.6这个库版本过低,执行命令查看这个动态库支持的CXXABI版本。

[root@bi-server-1 magi_system]# sudo strings /lib64/libstdc++.so.6 | grep 'CXXABI'
CXXABI_1.3
CXXABI_1.3.1
CXXABI_1.3.2
CXXABI_1.3.3
CXXABI_1.3.4
CXXABI_1.3.5
CXXABI_1.3.6
CXXABI_1.3.7
CXXABI_TM_1

解决方案

1) 在本机上试图找到这个库的最新版。

[root@bi-server-1 magi_system]# find / -name 'libstdc++.so*'
/usr/lib/gcc/x86_64-redhat-linux/4.8.2/32/libstdc++.so
/usr/lib/gcc/x86_64-redhat-linux/4.8.2/libstdc++.so
/usr/lib64/libstdc++.so.6
/usr/lib64/libstdc++.so.6.0.19
/usr/share/gdb/auto-load/usr/lib64/libstdc++.so.6.0.19-gdb.py
/usr/share/gdb/auto-load/usr/lib64/libstdc++.so.6.0.19-gdb.pyc
/usr/share/gdb/auto-load/usr/lib64/libstdc++.so.6.0.19-gdb.pyo

这几个库我都用strings看了一下,都没有1.3.8.
2) 从其他地方找
这个网站下载

  • 试图 yuminstall失败了。
  • wget http://mirror.centos.org/centos/7/os/x86_64/Packages/libstdc+±4.8.5-44.el7.x86_64.rpm
  • 发现这个网站对应centos7包版本也是低的。
  1. 最终上网直接找到这个so,https://wwa.lanzoui.com/i8lnene。
  2. 下下来之后放到/usr/lib64/.
    删除原先的软连接,建立新的软连接
[root@bi-server-1 magi_system]# rm /usr/lib64/libstdc++.so.6
rm: remove symbolic link ‘/usr/lib64/libstdc++.so.6’? y
[root@bi-server-1 magi_system]# ln -s /usr/lib64/libstdc++.so.6.0.26 /usr/lib64/libstdc++.so.6
[root@bi-server-1 magi_system]# sudo strings /lib64/libstdc++.so.6 | grep 'CXXABI'
CXXABI_1.3
CXXABI_1.3.1
CXXABI_1.3.2
CXXABI_1.3.3
CXXABI_1.3.4
CXXABI_1.3.5
CXXABI_1.3.6
CXXABI_1.3.7
CXXABI_1.3.8
CXXABI_1.3.9
CXXABI_1.3.10
CXXABI_1.3.11
CXXABI_1.3.12
CXXABI_TM_1
CXXABI_FLOAT128
CXXABI_1.3
CXXABI_1.3.11
CXXABI_1.3.2
CXXABI_1.3.6
CXXABI_FLOAT128
CXXABI_1.3.12
CXXABI_1.3.9
CXXABI_1.3.1
CXXABI_1.3.5
CXXABI_1.3.8
CXXABI_1.3.4
CXXABI_TM_1
CXXABI_1.3.7
CXXABI_1.3.10
CXXABI_1.3.3

成功

你可能感兴趣的:(安装报错处理,深度学习,人工智能)