LoginSignup
3
2

More than 5 years have passed since last update.

macOS SierraでのXGBoostインストール

Last updated at Posted at 2017-09-15

macOS SierraでXGBoostインストールしたところエラーが出たため、
以下にインストールの方法と対処方法を記載する。

環境

% python -V                                                             
Python 3.6.2 :: Anaconda custom (x86_64)
% sw_vers
ProductName:    Mac OS X
ProductVersion: 10.12.6
BuildVersion:   16G29

boneyard、llvm のインストール

brew tap homebrew/boneyard
brew install llvm 

clang-ompのエイリアスの設定

自分は.zshrcに以下を設定した。

alias clang-omp='/usr/local/opt/llvm/bin/clang -fopenmp -L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib'
alias clang-omp++='/usr/local/opt/llvm/bin/clang++ -fopenmp -L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib’

XGboostインストール

brew install gcc@5
pip install xgboost

gcc@5をインストールしないでxgboostをインストールしようとすると
以下のエラーとなった。
Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-rz1rux_4/xgboost/

3
2
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
3
2