Skip to main content
W&B integrates with Databricks by customizing the W&B Jupyter notebook experience in the Databricks environment. This page shows you how to install and authenticate W&B on a Databricks cluster so that you can track experiments and log metrics from notebooks running on Spark.

Configure Databricks

To use W&B from a Databricks notebook, you must install the wandb package on the cluster and configure authentication so your notebooks can log to W&B.
  1. Install wandb in the cluster In your cluster configuration, choose your cluster, then click Libraries > Install New > PyPI, and add the package wandb.
  2. Set up authentication To authenticate your W&B account, add a Databricks secret that your notebooks can query at runtime. This avoids hard-coding your API key in notebooks.

Examples

The following examples show how to use the previous secret to log in and begin logging from a Databricks notebook.

Basic example

Sweeps

Notebooks that use wandb.sweep() or wandb.agent() must set the entity and project as environment variables: