1、先通过brew安装 cmake、gcc
brew install cmake
brew install libomp
brew install gcc@7 --without-multilib
2、再make安装LightGBM:
git clone --recursive https://github.com/Microsoft/LightGBM ; cd LightGBM
export CXX=g++-7 CC=gcc-7
mkdir build ; cd build
cmake ..
make -j4
3、pip安装构刚才构建好的文件
cd ~/LightGBM
pip install lightgbm
cp ./lib_lightgbm.so 你的python site package下的lightbgm目录
或者
1、先通过brew安装 cmake、gcc
brew install cmake
brew install libomp
brew install gcc@7 --without-multilib
2、pip下编译安装lgb
pip3 install --no-binary :all: lightgbm