Skip to content

Cannot launch via docker compose due to torchaudio / torch dep #17

Open
@barapa

Description

@barapa

Error:

1.856 ERROR: Cannot install torch and torchaudio==2.2.0 because these package versions have conflicting dependencies.
1.856 
1.856 The conflict is caused by:
1.856     The user requested torch
1.856     torchaudio 2.2.0 depends on torch==2.2.0

Full Command Output

docker compose -f docker-compose.gpu.yml up --build --scale celery_worker=3
WARN[0000] /Users/br/development/scratch/docling-api/docker-compose.gpu.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion 
[+] Running 9/9
 ✔ redis Pulled                                                                                                                                                                                                                                                                                                                                                                                                                     2.9s 
   ✔ bca4290a9639 Pull complete                                                                                                                                                                                                                                                                                                                                                                                                     0.5s 
   ✔ 71d95c83bebf Pull complete                                                                                                                                                                                                                                                                                                                                                                                                     0.5s 
   ✔ 408d2517194f Pull complete                                                                                                                                                                                                                                                                                                                                                                                                     0.7s 
   ✔ 2df855f10a8a Pull complete                                                                                                                                                                                                                                                                                                                                                                                                     0.8s 
   ✔ c20bcf0359f9 Pull complete                                                                                                                                                                                                                                                                                                                                                                                                     2.0s 
   ✔ b2abc1015970 Pull complete                                                                                                                                                                                                                                                                                                                                                                                                     2.1s 
   ✔ 4f4fb700ef54 Pull complete                                                                                                                                                                                                                                                                                                                                                                                                     2.1s 
   ✔ 36d8034ca5a7 Pull complete                                                                                                                                                                                                                                                                                                                                                                                                     2.1s 
Compose now can delegate build to bake for better performances
Just set COMPOSE_BAKE=true
[+] Building 42.3s (12/15)                                                                                                                                                                                                                                                                                                                                                                                          docker:desktop-linux
 => [celery_worker internal] load build definition from Dockerfile                                                                                                                                                                                                                                                                                                                                                                  0.0s
 => => transferring dockerfile: 1.39kB                                                                                                                                                                                                                                                                                                                                                                                              0.0s
 => [celery_worker internal] load metadata for docker.io/library/python:3.12-slim-bookworm                                                                                                                                                                                                                                                                                                                                          0.6s
 => [celery_worker auth] library/python:pull token for registry-1.docker.io                                                                                                                                                                                                                                                                                                                                                         0.0s
 => [celery_worker internal] load .dockerignore                                                                                                                                                                                                                                                                                                                                                                                     0.0s
 => => transferring context: 2B                                                                                                                                                                                                                                                                                                                                                                                                     0.0s
 => [celery_worker  1/10] FROM docker.io/library/python:3.12-slim-bookworm@sha256:aaa3f8cb64dd64e5f8cb6e58346bdcfa410a108324b0f28f1a7cc5964355b211                                                                                                                                                                                                                                                                                  3.5s
 => => resolve docker.io/library/python:3.12-slim-bookworm@sha256:aaa3f8cb64dd64e5f8cb6e58346bdcfa410a108324b0f28f1a7cc5964355b211                                                                                                                                                                                                                                                                                                  0.0s
 => => sha256:aaa3f8cb64dd64e5f8cb6e58346bdcfa410a108324b0f28f1a7cc5964355b211 9.12kB / 9.12kB                                                                                                                                                                                                                                                                                                                                      0.0s
 => => sha256:8205faa412653fda14c4226a206e6882eec0443ebc700a89d2f0aa11efd78b1b 1.75kB / 1.75kB                                                                                                                                                                                                                                                                                                                                      0.0s
 => => sha256:ce3d6e72114bba676dd0ebae79fc3f642c2a8c83441c31a28a9d65b8f7714527 5.52kB / 5.52kB                                                                                                                                                                                                                                                                                                                                      0.0s
 => => sha256:d51c377d94dadb60d549c51ba66d3c4eeaa8bace4935d570ee65d8d1141d38fc 28.05MB / 28.05MB                                                                                                                                                                                                                                                                                                                                    1.4s
 => => sha256:987cac002684c8b2119edb1ec5fe98f5448ad8d2a2c6562214ec315072fe6657 3.33MB / 3.33MB                                                                                                                                                                                                                                                                                                                                      0.8s
 => => sha256:d99823c959139ef6b96810de4dea4f3dea367209f1d7f96aa9cfbfe280e6ac50 13.57MB / 13.57MB                                                                                                                                                                                                                                                                                                                                    1.0s
 => => sha256:ca703dfadc6881a4354583f19d51206f08e11847b2a9f7b245a9d55c541a3ff3 250B / 250B                                                                                                                                                                                                                                                                                                                                          0.9s
 => => extracting sha256:d51c377d94dadb60d549c51ba66d3c4eeaa8bace4935d570ee65d8d1141d38fc                                                                                                                                                                                                                                                                                                                                           1.2s
 => => extracting sha256:987cac002684c8b2119edb1ec5fe98f5448ad8d2a2c6562214ec315072fe6657                                                                                                                                                                                                                                                                                                                                           0.1s
 => => extracting sha256:d99823c959139ef6b96810de4dea4f3dea367209f1d7f96aa9cfbfe280e6ac50                                                                                                                                                                                                                                                                                                                                           0.6s
 => => extracting sha256:ca703dfadc6881a4354583f19d51206f08e11847b2a9f7b245a9d55c541a3ff3                                                                                                                                                                                                                                                                                                                                           0.0s
 => [celery_worker internal] load build context                                                                                                                                                                                                                                                                                                                                                                                     0.1s
 => => transferring context: 7.75MB                                                                                                                                                                                                                                                                                                                                                                                                 0.1s
 => [celery_worker  2/10] WORKDIR /app                                                                                                                                                                                                                                                                                                                                                                                              0.3s
 => [celery_worker  3/10] RUN apt-get update     && apt-get install -y redis-server libgl1 libglib2.0-0 curl wget git procps     && apt-get clean                                                                                                                                                                                                                                                                                  12.7s
 => [celery_worker  4/10] RUN pip install poetry     && poetry config virtualenvs.create false                                                                                                                                                                                                                                                                                                                                      7.2s 
 => [celery_worker  5/10] COPY pyproject.toml poetry.lock ./                                                                                                                                                                                                                                                                                                                                                                        0.0s 
 => [celery_worker  6/10] RUN poetry install --no-interaction --no-root                                                                                                                                                                                                                                                                                                                                                            16.2s 
 => ERROR [celery_worker  7/10] RUN if [ "false" = "true" ]; then     pip install --no-cache-dir torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu;     else     pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121;     fi                                                                                                                                         1.9s 
------                                                                                                                                                                                                                                                                                                                                                                                                                                   
 > [celery_worker  7/10] RUN if [ "false" = "true" ]; then     pip install --no-cache-dir torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu;     else     pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121;     fi:                                                                                                                                                    
0.330 Looking in indexes: https://download.pytorch.org/whl/cu121                                                                                                                                                                                                                                                                                                                                                                         
0.330 Requirement already satisfied: torch in /usr/local/lib/python3.12/site-packages (2.6.0)                                                                                                                                                                                                                                                                                                                                            
0.330 Requirement already satisfied: torchvision in /usr/local/lib/python3.12/site-packages (0.21.0)                                                                                                                                                                                                                                                                                                                                     
0.585 Collecting torchaudio                                                                                                                                                                                                                                                                                                                                                                                                              
0.702   Downloading https://download.pytorch.org/whl/torchaudio-2.2.0-cp312-cp312-linux_aarch64.whl (1.6 MB)
0.930      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.6/1.6 MB 8.4 MB/s eta 0:00:00
0.941 Requirement already satisfied: filelock in /usr/local/lib/python3.12/site-packages (from torch) (3.17.0)
0.941 Requirement already satisfied: typing-extensions>=4.10.0 in /usr/local/lib/python3.12/site-packages (from torch) (4.12.2)
0.943 Requirement already satisfied: setuptools in /usr/local/lib/python3.12/site-packages (from torch) (75.8.2)
0.943 Requirement already satisfied: sympy==1.13.1 in /usr/local/lib/python3.12/site-packages (from torch) (1.13.1)
0.944 Requirement already satisfied: networkx in /usr/local/lib/python3.12/site-packages (from torch) (3.4.2)
0.944 Requirement already satisfied: jinja2 in /usr/local/lib/python3.12/site-packages (from torch) (3.1.5)
0.945 Requirement already satisfied: fsspec in /usr/local/lib/python3.12/site-packages (from torch) (2025.2.0)
0.947 Requirement already satisfied: mpmath<1.4,>=1.1.0 in /usr/local/lib/python3.12/site-packages (from sympy==1.13.1->torch) (1.3.0)
0.948 Requirement already satisfied: numpy in /usr/local/lib/python3.12/site-packages (from torchvision) (2.2.3)
0.949 Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in /usr/local/lib/python3.12/site-packages (from torchvision) (11.1.0)
1.049 INFO: pip is looking at multiple versions of torchaudio to determine which version is compatible with other requirements. This could take a while.
1.157 Collecting torchvision
1.337   Downloading https://download.pytorch.org/whl/torchvision-0.17.0-cp312-cp312-linux_aarch64.whl (14.0 MB)
1.760      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14.0/14.0 MB 33.7 MB/s eta 0:00:00
1.777 Requirement already satisfied: requests in /usr/local/lib/python3.12/site-packages (from torchvision) (2.32.3)
1.777 INFO: pip is looking at multiple versions of torchvision to determine which version is compatible with other requirements. This could take a while.
1.808   Downloading https://download.pytorch.org/whl/torchvision-0.2.0-py2.py3-none-any.whl (48 kB)
1.816 Requirement already satisfied: six in /usr/local/lib/python3.12/site-packages (from torchvision) (1.17.0)
1.849   Downloading https://download.pytorch.org/whl/torchvision-0.1.6-py3-none-any.whl (16 kB)
1.856 ERROR: Cannot install torch and torchaudio==2.2.0 because these package versions have conflicting dependencies.
1.856 
1.856 The conflict is caused by:
1.856     The user requested torch
1.856     torchaudio 2.2.0 depends on torch==2.2.0
1.856 
1.856 To fix this you could try to:
1.856 1. loosen the range of package versions you've specified
1.856 2. remove package versions to allow pip to attempt to solve the dependency conflict
1.856 
1.885 
1.885 [notice] A new release of pip is available: 24.3.1 -> 25.0.1
1.885 [notice] To update, run: pip install --upgrade pip
1.886 ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
------
failed to solve: process "/bin/sh -c if [ \"$CPU_ONLY\" = \"true\" ]; then     pip install --no-cache-dir torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu;     else     pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121;     fi" did not complete successfully: exit code: 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions