pip install lightgbm
jupyter lab的notebook中执行
会报错OSError: dlopen(/Users/lihuilong/opt/anaconda3/lib/python3.9/site-packages/lightgbm/lib_lightgbm.so, 0x0006): Library not loaded: '/usr/local/opt/libomp/lib/libomp.dylib' Referenced from: '/Users/lihuilong/opt/anaconda3/lib/python3.9/site-packages/light
import lightgbm as lgb
lgb_classifier = lgb.LGBMClassifier()
看了很多教程都不太能用,还修改了PATh路径下载。
最后用虚拟conda环境中重新安装才可以使用。
conda install lightgbm
import lightgbm as gbm
摘自:【老码农随心记】Mac安装LGB,报错:'/usr/lib/libomp.dylib' (no such file)的解决办法 - 腾讯云开发者社区-腾讯云