如有有conda 优先使用:

conda install lightgbm

直接使用pip安装使用报错:

Library not loaded

源码安装方法:

brew install cmake
brew install gcc

git clone --recursive https://github.com/Microsoft/LightGBM ; cd LightGBM
# cd到/usr/local/opt/ 路径下查看自己的gcc版本
export CXX=g++-7 CC=gcc-7
mkdir build ; cd build
cmake ..
make -j4

cd ../python-package && python setup.py install

测试安装是否成功:

import lightgbm as lgb

相关文章:

  • 2021-04-21
  • 2021-08-12
  • 2022-12-23
  • 2022-12-23
  • 2021-08-05
  • 2022-01-27
  • 2022-12-23
  • 2021-07-17
猜你喜欢
  • 2021-04-22
  • 2022-12-23
  • 2021-11-14
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2022-01-12
相关资源
相似解决方案