pip install lightgbm
安装成功但是报错,如下
OSError: dlopen(/Users/Cyan/anaconda3/lib/python3.7/site-packages/lightgbm/lib_lightgbm.so, 6): Library not loaded: /usr/local/opt/libomp/lib/libomp.dylib
Referenced from: /Users/Cyan/anaconda3/lib/python3.7/site-packages/lightgbm/lib_lightgbm.so
Reason: image not found
最后通过官方文档解决:
brew install libomp
只要通过上述命令安装一个libomp就可以正常使用lightgbm了
官方文档如下:
For macOS users:
Starting from version 2.2.1, the library file in distribution wheels is built by the Apple Clang (Xcode_8.3.3) compiler. This means that you don’t need to install the gcc compiler anymore. Instead of that you need to install the OpenMPlibrary, 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.