LoginSignup
2
2

More than 3 years have passed since last update.

pip install xgboostの時にerrorが出てお困りの方々へ

Last updated at Posted at 2020-05-02

なんか流行ってるし、Kaggleでもやりますかとなり結局はxgboostでしょ的なノリで
- os Mojave 10.14.6
- jupyter lab
- python 3.6.5
でやる気満々だった訳です。

pip install xgboostエラー出まくるやないかい!

公式には

brew install libomp

して、

pip3 install xgboost

簡単にインストールできるよ!もしパーミッションエラーが出たら--userを使ってね。
homebrewとpip最高だよね!・・・やかましいわ!めちゃくちゃエラー出るやん!!

と結構苦労したので、同じような境遇の方の助けになればと思い記事を書きます。
内容の説明はすっ飛ばして、とにかくxgboostを使いたいという心意気の方向けです。

Successfully installed xgboost-1.0.2までの過程

pip install xgboost

から始まってエラーを解消しながら最終的にインストールできるまでの過程をただ共有します。
たまにコメントでエラー文を貼り付けておきます。

gccは必要。

brew install gcc

この段階で
./xgboost/build-python.sh: line 21: cmake: command not found
っていうエラーがあったので

brew install cmake

次が時間かかりました。
使用コンパイラを設定するため

export CC=gcc-5
export CXX=g++-5

私の場合は、上記をやったのですが、
Could not find compiler set in environment variable CC:
CC=gcc-5
となってオチはただのタイポだったのですが、素晴らしく時間がかかりました。

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