Describes how to install, update, and authenticate to the Labelbox Python SDK.
Many actions and workflows available in the Labelbox app can be automated using the Python SDK, which provides access to the Labelbox API.
Make sure pip
is installed and up-to-date.
Use the Workspace settings menu of the Labelbox app to create an API key. Store your key in a safe place, as you cannot view it after it has been created.
Python: 3.9 - 3.13
After you create an API key, you can start using our Python SDK.
To install, run either pip install labelbox
orpip install "labelbox[data]"
in your command line.
Module | Description |
---|---|
"labelbox[data]" | Installs all required dependencies (libraries, tools to manipulate annotations, and more.) |
labelbox | Installs all required libraries for client-only functionality |
To upgrade to the latest version, use your package manager: pip install --upgrade labelbox
To run the Python SDK in a Docker container, use the included Dockerfile as a starting place.
Related info:
https://github.com/Labelbox/labelbox-python/releases/latest/
You need an API key to authenticate your client. You can:
Save your key to an environment variable:
Then, import and initialize the API Client.
Paste your API key directly into your script (not recommended)
Remember that your API key authorizes access to Labelbox, your account, and your data assets; treat it as carefully as any other set of credentials, and make sure the scope of the key is set according to the usage is meant for.