conda环境报错:libgomp.so.1: version `GOMP_4.0' not found?libstdc++.so.6: version `CXXABI_1.3.8/9' not...

问题

之前的conda环境好好地,最近不知为何被破坏了,运行即报错:

/miniconda3/opt/lib/R/bin/exec/R: /miniconda3/opt/lib/R/bin/exec/../../lib/../../libgomp.so.1: version `GOMP_4.0' not found (required by /miniconda3/opt/lib/R/bin/exec/../../lib/libR.so)
/miniconda3/opt/lib/R/bin/exec/R: /miniconda3/opt/lib/R/bin/exec/../../lib/../.././libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /miniconda3/opt/lib/R/bin/exec/../../lib/../../libicuuc.so.68)
/miniconda3/opt/lib/R/bin/exec/R: /miniconda3/opt/lib/R/bin/exec/../../lib/../.././libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /miniconda3/opt/lib/R/bin/exec/../../lib/../../libicuuc.so.68)
/miniconda3/opt/lib/R/bin/exec/R: /miniconda3/opt/lib/R/bin/exec/../../lib/../.././libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /miniconda3/opt/lib/R/bin/exec/../../lib/../../libicui18n.so.68)
/miniconda3/opt/lib/R/bin/exec/R: /miniconda3/opt/lib/R/bin/exec/../../lib/../.././libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /miniconda3/opt/lib/R/bin/exec/../../lib/../../libicui18n.so.68)

原因

conda对应目录下的“libgomp.so.1”和“libstdc++.so.6”动态库文件(lib)中相关模块的版本比较旧,不包含相应版本模块导致的。

系统中动态库存放路径在:/usr/lib/x86_64-linux-gnu/ 或 /usr/lib/ 或 /usr/lib64/。
anaconda中动态库存放路径是:~/anaconda2/lib。
如果系统版本高,则用它替换掉anaconda中的低版本,否则升级。

查看这两个路径下库的版本:

strings /usr/lib/libstdc++.so.6 | grep 'CXXABI'
strings /miniconda3/opt/lib/R/bin/exec/../../lib/../.././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

我的系统中的libgomp.so.1可以直接复制替换掉anaconda中的libgomp.so.1,而libstdc++.so.6没作用,因为两者一样。
那么需要升级系统的libstdc++.so.6。

解决

下载libstdc++.so.6.0.26
链接: https://pan.baidu.com/s/1qqXBMxmKMDpp-jycRnHyMQ 提取码: bv88
将文件移动到系统目录/usr/lib64/下面。

ll libstdc++.so*
chmod +x libstdc++.so.6.0.26
mv libstdc++.so.6 libstdc++.so.6.bak
ln -s libstdc++.so.6.0.26 libstdc++.so.6
strings /usr/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

直接将系统中的libstdc++.so.6复制替换掉anaconda中的libstdc++.so.6即可。

参考:
https://www.cnblogs.com/mtcnn/p/9411783.html
https://cloud.tencent.com/developer/article/1814047

你可能感兴趣的:(conda环境报错:libgomp.so.1: version `GOMP_4.0' not found?libstdc++.so.6: version `CXXABI_1.3.8/9' not...)