データサイエンス

Anaconda環境でXGBoostをインストールする方法【MacOS】

MacbookでkaggleをやっているのですがXGBoostを使おうとしたときにエラーが発生。

$ conda install xgboost

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  - xgboost

Current channels:

  - https://repo.anaconda.com/pkgs/main/osx-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/osx-64
  - https://repo.anaconda.com/pkgs/r/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

 

調べてみるとコマンドが違うようでした。

 

$ conda install -c conda-forge xgboost

 

上記コマンドを実行するとインストールできました!

RELATED POST