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
最后通过官方文档解决:
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
.
只要通过 brew install libomp 安装一个 li