Skip to main content
The W&B Python SDK, accessible at wandb, enables you to train and fine-tune models, and manage models from experimentation to production.
After performing your training and fine-tuning operations with this SDK, you can use the Public API to query and analyze the data that was logged, and the Reports and Workspaces API to generate a web-publishable report summarizing your work.

Sign up and create an API key

To authenticate your machine with W&B, you must first generate an API key at User Settings.

Install and import packages

Install the W&B Python SDK using pip:

Import W&B Python SDK

The following code snippet demonstrates how to import the W&B Python SDK and initialize a run. Replace <team_entity> with your team entity name.

Python SDK extras

Install optional Python extras to extend the functionality of the W&B Python SDK. Specify the name of the extra you want to install within square brackets after wandb. The syntax is:
For example, to install W&B with Google Cloud Storage support, run:
Install more than one optional dependency by separating them with commas:
The following table lists Python SDK extras and their suggested use cases. The following tabs provide more details about each extra, including installation instructions, dependencies, and code examples.
Use the gcp extra if you add reference artifacts that start with gs:// URIs.Installation:
Dependencies:
  • google-cloud-storage
Example: