LoginSignup
8
1

More than 3 years have passed since last update.

macでxgboostが動かない場合の対処方法

Last updated at Posted at 2020-10-09

現象

anacondaなどを使って

import xgboost as xgb

をしようとすると以下のようなエラーが出る場合がある

opt/anaconda3/envs/locale1/lib/python3.7/site-packages/xgboost/core.py in _load_lib()
    162             '`brew install libomp` to install OpenMP runtime.\n' +
    163             '  * You are running 32-bit Python on a 64-bit OS\n' +
--> 164             'Error message(s): {}\n'.format(os_error_list))
    165     lib.XGBGetLastError.restype = ctypes.c_char_p
    166     lib.callback = _get_log_callback_func()

XGBoostError: XGBoost Library (libxgboost.dylib) could not be loaded.
Likely causes:
  * OpenMP runtime is not installed (vcomp140.dll or libgomp-1.dll for Windows, libomp.dylib for Mac OSX, libgomp.so for Linux and other UNIX-like OSes). Mac OSX users: Run `brew install libomp` to install OpenMP runtime.
  * You are running 32-bit Python on a 64-bit OS
Error message(s): ~~~

対処方法

以下を実行してあげれば動きました

brew install libomp
8
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
1