MacのLightGBMでエラー image not found

MacOS 10.15.5

LightGBMを使いたくなったのでpipでインストールしたら表題のエラー。

公式ドキュメントを見てみる。

Installation Guide — LightGBM 4.3.0.99 documentation

On macOS LightGBM can be installed using Homebrew, or can be built using CMake and Apple Clang or gcc.

ソースからビルドするのは面倒だったのでHomebrewを試す。

brew install lightgbm

しかしエラーは解決しない。

githubのリポジトリを見てみる。

LightGBM/python-package at master · microsoft/LightGBM
A fast, distributed, high performance gradient boosting (GBT, GBDT, GBRT, GBM or MART) framework based on decision tree ...


For macOS (we provide wheels for 3 newest macOS versions) users:

Starting from version 2.2.1, the library file in distribution wheels is built by the Apple Clang (Xcode_8.3.3 for versions 2.2.1 – 2.3.1, and Xcode_9.4.1 from version 2.3.2) compiler. This means that 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.

OpenMPとwheelがあればいいらしい。

brew install libomp
pip install wheel
pip install lightgbm

これでエラーは消え、LightGBMを使うことが出来た。

コメント

タイトルとURLをコピーしました