> For the complete documentation index, see [llms.txt](https://docs.unitlab.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.unitlab.ai/api-sdk-cli/get-started/install-the-python-sdk-and-cli.md).

# Install the Python SDK and CLI

Install the Unitlab Python SDK and CLI, verify version 3.1.3, and prepare your first data or annotation upload.

The `unitlab` package provides both the Python SDK and the `unitlab` command-line tool. Use Python 3.10 or newer. The upload examples in these guides are checked against **Unitlab 3.1.3**.

{% stepper %}
{% step %}

## Create a Python environment

Create a working directory for your first example, then create its environment:

```bash
mkdir road-scenes
cd road-scenes
python -m venv .venv
```

If your system uses `python3`, use `python3 -m venv .venv` for this first command. After activation, the examples use `python`.

Activate it on macOS or Linux:

```bash
source .venv/bin/activate
```

On Windows PowerShell:

```powershell
.venv\Scripts\Activate.ps1
```

{% endstep %}

{% step %}

## Install Unitlab

For the version used in these examples:

```bash
python -m pip install "unitlab==3.1.3"
```

For an existing installation that you intentionally want to upgrade, use this command instead. It may install a version newer than the examples:

```bash
python -m pip install --upgrade unitlab
```

{% endstep %}

{% step %}

## Verify the SDK and CLI

```bash
python -c "from importlib.metadata import version; print(version('unitlab'))"
unitlab --version
unitlab --help
```

With the pinned installation, both version checks should report `3.1.3`; `unitlab --help` should list the command groups. The Python package and CLI should report the same version. If they differ, activate the environment again and check which `unitlab` executable your shell resolves.
{% endstep %}

{% step %}

## Authenticate and choose a guide

Follow [Authentication and configuration](/api-sdk-cli/get-started/authentication-and-configuration.md) to connect the SDK and CLI to your workspace.

| Task                                                    | Guide                                                                           |
| ------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Upload a file or folder, or loop over a local file list | [Project uploads](/api-sdk-cli/sdks/project-uploads.md)                         |
| Upload reusable data to the Asset library               | [Assets and custom metadata](/api-sdk-cli/sdks/assets-and-custom-metadata.md)   |
| Import existing annotations                             | [Annotation imports](/api-sdk-cli/sdks/annotation-imports.md)                   |
| Group related files into one work item                  | [Data Group automation](/api-sdk-cli/sdks/data-group-automation.md)             |
| Upload from a terminal                                  | [CLI projects and Data Units](/api-sdk-cli/clis/cli-projects-and-data-units.md) |
| {% endstep %}                                           |                                                                                 |
| {% endstepper %}                                        |                                                                                 |

{% hint style="info" %}
Annotation import is available through the Python SDK in this version. The CLI has data-upload and grouping commands, but no annotation-import command. The SDK guide shows how to run an import script from a terminal.
{% endhint %}

For repeatable jobs, pin the package version in your dependency file. After an upgrade, check the installed command help and run a small representative upload before processing a full dataset.

## Related resources

* [Unitlab SDK source and examples](https://github.com/teamunitlab/unitlab-sdk)
* [Upload through the Unitlab interface](https://docs.unitlab.ai/documentation/data/data-upload)
