- 按照对应的github地址,分别下载两个安装包
- brew 安装 cmake, gcc, llvm(用于多线程)
-
配置 .zshrc 环境,具体如下:
环境变量 - 开始编译对应安装包
pip install --no-binary :all: lightgbm
pip install lightgbm
- 报错
<module 'lightgbm' from '/Users/allenhsu/anaconda3/lib/python3.7/sit packages/lightgbm/init.py'>
/Users/allenhsu/anaconda3/lib/python3.7/site-packages/lightgbm/init.py:46: UserWarning: Starting from version 2.2.1, the library file in distribution wheels for macOS is built by the Apple Clang (Xcode_8.3.1) compiler.
This means that in case of installing LightGBM from PyPI via thepip install lightgbm
command, you don't need to install the gcc compiler anymore.
Instead of that, you need to install the OpenMP library, which is required for running LightGBM on the system with the Apple Clang compiler.
You can install the OpenMP library by the following command:brew install libomp
.
"You can install the OpenMP library by the following command:brew install libomp
.", UserWarning) - 参考文献:
- http://liujunworld.com/2018/10/16/Mac%E4%B8%8B%E5%AE%89%E8%A3%85lightGBM/
- https://blog.csdn.net/molu_chase/article/details/78629663
- 注意: 现在我是成功安装了lightgbm 至于xgboost,等我用到的时候在安装吧。
网友评论