MAC安装lightgbm,xgboost失败error的解决方法
作者:互联网
Mac系统+Anaconda3+python3.8.8
安装lightgbm,xgboost这两个集成学习算法的包是成功了的
但是导入时一直报错
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
<ipython-input-5-b18b3f8a6dc8> in <module>
----> 1 import lightgbm
dlopen(/Users/kumahiroshi/opt/anaconda3/lib/python3.8/site-packages/lightgbm/lib_lightgbm.so, 6): Library not loaded: /usr/local/opt/libomp/lib/libomp.dylib
Referenced from: /Users/kumahiroshi/opt/anaconda3/lib/python3.8/site-packages/lightgbm/lib_lightgbm.so
Reason: image not found
就是一直报: OSError Reason: image not found
通过查阅资料后发现只需要在 终端 运行这行代码后重新导入即可成功:brew install libomp
brew install libomp
成功了!
需要软件:Homebrew, 安装该软件可以参考:https://www.jianshu.com/p/8a2572fe60be
安装代码:ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
标签:opt,lightgbm,lib,xgboost,libomp,MAC,install,python3.8 来源: https://blog.csdn.net/sunflowers__k/article/details/121706515