Window下用 Anaconda 安装lightgbm很简单,直接用conda install lightgbm
就可以了
实验室的Linux服务器不能联网,这可就废劲了
/home/feng/anaconda3/envs/py36/bin/…/lib/libgomp.so.1: version `GOMP_4.0’ not found
LigjtGBM网址:https://github.com/Microsoft/LightGBM
unzip LightGBM-master.zip
需要安装有CMake 、 gcc 、glibc >= 2.14
CMake安装可以参考:https://blog.csdn.net/lhl1124281072/article/details/83188055
cd LightGBM-master/
mkdir build ; cd build
cmake ..
make -j4
cd ..
cd ./python-package/
python setup.py install --precompile
到这已经安装成功了
1.LightGBM/python软件包/
2.LightGBM Installation Guide/
OSError: /home/feng/anaconda3/envs/py36/bin/…/lib/libgomp.so.1: version `GOMP_4.0’ not found (required by /home/feng/Downloads/PythonPack/LightGBM-master/python-package/lightgbm/…/…/lib_lightgbm.so)
libgomp.so.1是gcc的动态库文件
**步骤1:**使用以下命令检查anconda中的libgomp.so.1文件是否包含所需的版本GOMP_4.0(在所有步骤中,请自行替换路径):
strings /home/feng/anaconda3/envs/py36/bin/../lib/libgomp.so.1 |grep GOMP
其中的/home/feng/anaconda3/envs/py36/bin/../lib/libgomp.so.1 |grep GOMP strings /usr/lib/x86_64-linux-gnu/libgomp.so.1
路径就是报错信息中的
查看返回的信息,如果没有GOMP_4.0版本,请转到请转到步骤2
步骤2:
查看Linux系统动态库文件包含的模块版本:路径在strings /usr/lib/libgomp.so.1 | grep GOMP
或者strings /usr/lib/x86_64-linux-gnu/libgomp.so.1 | grep GOMP
中,
我的是
strings /usr/lib/x86_64-linux-gnu/libgomp.so.1 |grep GOMP
可以看到,返回的有 GOMP_4.0,进入下一步。
如果没有就是gcc版本太低,需要升级gcc,(这可就来事情了,哈哈)
步骤3:
sudo rm -rf /home/feng/anaconda3/envs/py36/bin/../lib/libgomp.so.1
sudo ln -s /usr/lib/x86_64-linux-gnu/libgomp.so.1 /home/feng/anaconda3/envs/py36/bin/../lib/libgomp.so.1
就可以了,注意上面的路径要改成自己的。
OSError: /home/feng/anaconda3/envs/py36/lib/python3.6/site-packages/scipy/sparse/…/…/…/…/libstdc++.so.6: version `GLIBCXX_3.4.20’ not found (required by /home/feng/Downloads/PythonPack/LightGBM-master/python-package/lightgbm/…/…/lib_lightgbm.so)
这一个报错的处理方法和上面的类似,就不详细讲解了
strings /home/feng/anaconda3/envs/py36/lib/python3.6/site-packages/scipy/sparse/../../../../libstdc++.so.6 |grep GLIBCXX
strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 |grep GLIBCXX
sudo rm -rf /home/feng/anaconda3/envs/py36/lib/python3.6/site-packages/scipy/sparse/../../../../libstdc++.so.6
sudo ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /home/feng/anaconda3/envs/py36/lib/python3.6/site-packages/scipy/sparse/../../../../libstdc++.so.6
LightGBM Issues
“libgomp.so.1: version GOMP_4.0' not found” || “libstdc++.so.6: version
CXXABI_1.3.8’ not found”错误