Install XGBoost on Databricks

If you need to install XGBoost on Databricks Runtime or use a different version than the one pre-installed with Databricks Runtime ML, follow these instructions.

Install XGBoost on Databricks Runtime ML

XGBoost is included in Databricks Runtime ML. You can use these libraries in Databricks Runtime ML without installing any packages. See Databricks Runtime for Machine Learning.

For the version of XGBoost installed in the Databricks Runtime ML version you are using, see the release notes. To install other Python versions in Databricks Runtime ML, install XGBoost as a Databricks PyPI library. Specify it as the following and replace <xgboost version> with the desired version.

xgboost==<xgboost version>

Install XGBoost on Databricks Runtime

  • Python package: Execute the following command in a notebook cell:

    %pip install xgboost
    

To install a specific version, replace <xgboost version> with the desired version:

  %pip install xgboost==<xgboost version>
  • Scala/Java packages: Install as a Databricks library with the Spark Package name xgboost-linux64.