Dependencies¶

Required dependencies¶

The 3lc Python package declares several required dependencies, which are automatically installed when installing 3lc. The core surface — Tables, Runs, the Object Service, URL adapters — has no dependency on a deep-learning framework.

Optional dependencies¶

To avoid pulling in a large number of potentially unused packages, 3lc declares additional functionality behind optional extras. The following table lists the available extras and the packages they pull in:

Optional Dependencies¶

Installation

Dependencies

pip install 3lc[pandas]

pandas>=1.4.2

pip install 3lc[torch]

torch>=1.8.0, torchvision>=0.10.0

pip install 3lc[huggingface]

3lc[torch], datasets>=2.17.0, transformers<5.0.0,>=4.30.2, evaluate<1.0.0,>=0.4.1, accelerate>=1.2.1

pip install 3lc[gcs]

google-cloud-storage>=3.0.0, google-api-python-client>=2.194.0

pip install 3lc[abfs]

adlfs==2024.4.1, azure-storage-blob>=12.24.1

pip install 3lc[umap]

umap-learn<1.0.0,>=0.5.4, joblib<2.0.0,>=1.4.0, scikit-learn>=1.0.0

pip install 3lc[pacmap]

pacmap<0.9,>=0.7.1, joblib<2.0.0,>=1.4.0, annoy>=1.17.0, scikit-learn>=1.0.0

pip install 3lc[pyngrok]

pyngrok<8.0.0,>=7.1.3

PyTorch¶

PyTorch is required for any workflow that collects per-sample metrics from a model, and for constructing a Table from a torch.utils.data.Dataset. Specifically, the following entry points require torch (and, for VisionDataset features, torchvision):

If torch is not installed and one of these entry points is called, 3lc raises an ImportError pointing at pip install 3lc[torch]. The rest of the package — Tables, Runs, URL adapters, the Object Service, and the FunctionalMetricsCollector - all work without torch installed.

Installation¶

Prior to 3lc >= 3.0, torch and torchvision were required dependencies. They are now optional, so users only running torch-free workflows do not need them installed.

The simplest way to get a working setup is:

pip install 3lc[torch]

This installs whichever PyTorch wheel PyPI provides for your platform — at the time of writing, CPU-only wheels on Windows and macOS, and GPU-accelerated wheels on Linux.

For a build matched to a specific accelerator (CUDA, ROCm, MPS, etc.), follow the official PyTorch install instructions to pick the right index URL and wheel:

We recommend installing torch and torchvision before 3lc, or as part of the same pip install invocation, so that pip can respect any accelerator-specific index URL you pass:

  • pip install torch torchvision --index-url https://download.pytorch.org/whl/cu126 followed by pip install 3lc yields cu126 wheels.

  • pip install 3lc torch torchvision --index-url https://download.pytorch.org/whl/cu126 does the same in a single step.

If torch and torchvision are installed after 3lc[torch] and 3lc has already pulled the PyPI default wheels, either pin the full version including the local-version specifier (e.g. pip install torch==2.6.0+cu126 --index-url https://download.pytorch.org/whl/cu126), or pass --force-reinstall to override the existing wheels.

The 3lc[huggingface] extra depends on 3lc[torch] transitively, so installing it pulls torch and torchvision in as well.