Dependencies¶

Required dependencies¶

The 3lc Python package declares several required dependencies, which are automatically installed when installing 3lc.

Torch and torchvision¶

3LC is tightly integrated with, and therefore depends on, PyTorch and torchvision. For 3lc < 2.13, it is the user’s responsibility to install torch and torchvision. Since 3lc >= 2.13, 3lc declares torch and torchvision as required dependencies.

Therefore, when installing 3lc >= 2.13 and torch and torchvision are not present in your environment, they will be pulled from PyPI, which at the time of writing provides:

  • CPU-only wheels for Windows and MacOS

  • GPU-accelerated wheels on Linux

When installation of any nonstandard torch/torchvision is performed after installing 3lc >= 2.13, one must:

  • Either declare the full version number and include any accelerator-specific local version specifier, for example pip install torch==2.6.0+cu126 --index-url https://download.pytorch.org/whl/cu126.

  • Or use the --force-reinstall flag to ensure the package is installed from the specified index, which uninstalls the wheel installed from PyPI.

When installing 3lc >= 2.13 and torch and torchvision are present in your environment, or installed with the same call to pip install, any torch-specific index url and accelerator-specific local version specifier is respected.

  • For example, pip install torch torchvision --index-url https://download.pytorch.org/whl/cu126 followed by pip install 3lc will result in cu126 wheels.

  • Similarly, pip install 3lc torch torchvision --index-url https://download.pytorch.org/whl/cu126 will install cu126 wheels.

We therefore recommend to install torch and torchvision before 3lc, or as a part of the same invocation of pip install. If you are using 3lc < 2.13 the order does not matter, but torch and torchvision must be installed manually in order to use 3LC.

Optional dependencies¶

To avoid having a large number of potentially unused dependencies for the tlc Python package, the 3LC wheel also declares optional dependencies. The following table lists the available optional dependencies and which packages and version specifiers they declare:

Optional Dependencies¶

Installation

Dependencies

pip install 3lc[huggingface]

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

pip install 3lc[abfs]

adlfs==2024.4.1

pip install 3lc[umap]

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

pip install 3lc[pacmap]

pacmap<1.0.0,>=0.7.1, joblib<2.0.0,>=1.4.0

pip install 3lc[pyngrok]

pyngrok<8.0.0,>=7.1.3

pip install 3lc[lightning]

pytorch-lightning>=2.0.0