XGBoost遇到“Error message(s): [“/lib64/libstdc++.so.6: version `GLIBCXX

编程入门 行业动态 更新时间:2024-10-19 04:26:04

XGBoost遇到“Error <a href=https://www.elefans.com/category/jswz/34/1757085.html style=message(s): [“/lib64/libstdc++.so.6: version `GLIBCXX"/>

XGBoost遇到“Error message(s): [“/lib64/libstdc++.so.6: version `GLIBCXX

在Linux CentOS7和Python3.6的环境下,使用XGBoost报错,提示内容如下:

xgboost.core.XGBoostError: XGBoost Library (libxgboost.so) could not be loaded.
Likely causes:* OpenMP runtime is not installed (vcomp140.dll or libgomp-1.dll for Windows, libomp.dylib for Mac OSX, libgomp.so for Linux and other UNIX-like OSes). Mac OSX users: Run `brew install libomp` to install OpenMP runtime.* You are running 32-bit Python on a 64-bit OS
Error message(s): ["/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/python3/lib/python3.6/site-packages/xgboost/lib/libxgboost.so)"]

1、检查libstdc++.so.6
使用yum provides反查询文件在什么包中。

[root@bigdatahost python]# yum provides libstdc++.so.6
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile* base: mirrors.aliyun* epel: mirrors.tuna.tsinghua.edu* extras: mirrors.aliyun* nux-dextop: mirror.li.nux.ro* updates: mirrors.aliyun
libstdc++-4.8.5-44.el7.i686 : GNU Standard C++ Library
Repo        : base
Matched from:
Provides    : libstdc++.so.6

2、安装 libstdc+±4.8.5-44.el7.i686

 [root@localhost ~]# yum install libstdc++-4.8.5-44.el7.i686

3、查看libstdc++.so.6软连接情况

[root@bigdatahost lib64]# ls -al libstdc++.so.6
lrwxrwxrwx. 1 root root 19 Apr 27 08:20 libstdc++.so.6 -> libstdc++.so.6.0.19

4、从路径/usr/local/lib64拷贝文件libstdc++.so.6.0.21(或者更高版本,例如libstdc++.so.6.0.24)到路径/usr/lib64

[root@bigdatahost lib64]# cp /usr/local/lib64/libstdc++.so.6.0.21 libstdc++.so.6.0.21

5、重新设置libstdc++.so.6软连接
最好先备份原软连接libstdc++.so.6,再删除后重新配置libstdc++.so.6软连接。

[root@bigdatahost lib64]# cp libstdc++.so.6  libstdc++.so.6.bak19
[root@bigdatahost lib64]# rm -rf libstdc++.so.6
[root@bigdatahost lib64]# ln -s libstdc++.so.6.0.21 libstdc++.so.6

6、查看结果

[root@bigdatahost lib64]# strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX

参考:

libaineu2004 ,/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20’ not found问题解决方法 , CSDN博客,2017.08

Biu_diudiu ,错误排查:ImportError: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20’ not found,CSDN博客,2020.03

肖永威 , 基于CentOS7安装Python3计算环境与PyDev(Eclipse)开发工具日志(2021年) ,CSDN博客, 2021.04

更多推荐

XGBoost遇到“Error message(s): [“/lib64/libstdc++.so.6: version `GLIBCXX

本文发布于:2024-03-11 13:55:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1729124.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:message   Error   XGBoost   GLIBCXX   version

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!