Skip to content

uv pip install -e ".[test]" fails on Python 3.12 due to incompatible numba/llvmlite resolution #14067

Description

@gabe-engineers

Describe the bug

Installing the test dependencies from a fresh clone fails on Python 3.12.

librosa==0.11.0 permits numba>=0.51.0, and uv resolves this to numba==0.53.1, which requires llvmlite==0.36.0. That version of llvmlite only supports Python <3.10.

This occurs with the current uv==0.11.24 and the current Diffusers main branch. Diffusers declares python_requires=">=3.10.0" without an upper bound, so I expected the test extra to install on Python 3.12.

The official CUDA Dockerfiles already work around this dependency problem by installing compatible numba and llvmlite versions before diffusers[test]:

https://github.com/huggingface/diffusers/blob/main/docker/diffusers-pytorch-cuda/Dockerfile

Would it make sense to express the compatible Numba requirement in the test dependencies themselves? I would be happy to submit a PR if that is the preferred fix.

Reproduction

git clone https://github.com/huggingface/diffusers.git
cd diffusers

uv venv --python 3.12 .venv
source .venv/bin/activate

uv pip install -e ".[test]"

No UV_RESOLUTION, UV_OVERRIDE, UV_CONSTRAINT, or PIP_* environment variables were set.

Adding a compatible Numba requirement allows the dependency graph to resolve:

uv pip install --dry-run "numba>=0.59" -e ".[test]"

This selects:

numba==0.65.1
llvmlite==0.47.0

Logs

Resolved 113 packages in 4.25s
Building diffusers @ file:///.../diffusers
Built diffusers @ file:///.../diffusers
Building llvmlite==0.36.0

× Failed to build `llvmlite==0.36.0`
├─▶ The build backend returned an error
╰─▶ Call to `setuptools.build_meta:__legacy__.build_wheel` failed

RuntimeError: Cannot install on Python version 3.12.2; only versions
>=3.6,<3.10 are supported.

hint: `llvmlite` (v0.36.0) was included because `diffusers[test]`
(v0.39.0.dev0) depends on `librosa` (v0.11.0) which depends on
`numba` (v0.53.1) which depends on `llvmlite`

System Info

Diffusers commit: 577b28f8f5d30eabdd357d74944cd76568292faf
Diffusers version: 0.39.0.dev0
Python: 3.12.2
uv: 0.11.24
OS: macOS 26.5, arm64
Installation: fresh clone and clean virtual environment

diffusers-cli env is unavailable because installation fails before Diffusers is installed.

I also encountered the same dependency chain under Linux with Python 3.12.3.

Who can help?

@DN6 @sayakpaul

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions