ERROR: Cannot install -r /tmp/requirements.txt (line 4), -r /tmp/requirements.txt (line 5), -r /tmp/requirements.txt (line 6), -r /tmp/requirements.txt (line 7) and huggingface-hub==0.24.0 because these package versions have conflicting dependencies.
The conflict is caused by:
The user requested huggingface-hub==0.24.0
accelerate 1.2.1 depends on huggingface-hub>=0.21.0
transformers 4.45.0 depends on huggingface-hub<1.0 and >=0.23.2
diffusers 0.29.2 depends on huggingface-hub>=0.23.2
gradio 5.44.0 depends on huggingface-hub<1.0 and >=0.33.5
Additionally, some packages in these conflicts have no matching distributions available for your environment:
huggingface-hub
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip to attempt to solve the dependency conflict
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
--> ERROR: process "/bin/sh -c pip install --no-cache-dir -r /tmp/requirements.txt" did not complete successfully: exit code: 1
Hmm…?
You have two separate problems in that log.
- A real dependency conflict.
- Pip also cannot find any installable
huggingface-hubbuild for your environment once it considers the required version ranges.
1) What pip is telling you, in plain terms
Pip is solving a set of version constraints (your pins + every package’s “requires”). It must pick one version of huggingface-hub that satisfies all of these at once.
From your error:
- You pinned
huggingface-hub==0.24.0 transformers 4.45.0needshuggingface-hub>=0.23.2,<1.0diffusers 0.29.2needshuggingface-hub>=0.23.2accelerate 1.2.1needshuggingface-hub>=0.21.0gradio 5.44.0needshuggingface-hub>=0.33.5,<1.0
So the strictest requirement is Gradio: huggingface-hub must be at least 0.33.5. Your pin forces it to be 0.24.0. Those cannot both be true. Therefore pip correctly throws ResolutionImpossible. The pip docs describe this exact class of error (“two packages require incompatible versions of the same dependency”). (pip)
2) Why you also see “no matching distributions available for your environment”
This line:
some packages … have no matching distributions available for your environment: huggingface-hub
means: after pip considers the allowed versions (especially the >=0.33.5,<1.0 pressure coming from Gradio), it cannot find any build of huggingface-hub that is compatible with your environment markers (Python version, OS, architecture, index URL, etc.).
The most common causes:
Cause A. Your Python is too old for your chosen stack
Gradio’s own PyPI page states: “Gradio requires Python 3.10 or higher.” (PyPI)
If you build on Python 3.8 or 3.9, pip can end up in a state where it cannot select compatible releases across the set, and you get “no matching distributions” symptoms during resolution.
Also, Hugging Face’s docs note huggingface_hub is tested on Python 3.9+. (Hugging Face)
“Tested on” is not identical to “requires,” but in practice many ecosystems gradually drop older Pythons via Requires-Python metadata, and installers will refuse incompatible builds. The Python Packaging Authority documents how Requires-Python is used and how installers use it when selecting distributions. (Python Packaging)
Cause B. You are not installing from normal PyPI, or your index is incomplete
If your Docker build uses a private mirror, Artifactory, a restricted index, or --no-index, you can see “no matching distributions” simply because that index does not carry the needed huggingface-hub versions.
Cause C. Your environment is “nonstandard” (WebAssembly, Pyodide, etc.)
This is the same shape of failure: Gradio’s own issue tracker shows an example where an environment (Pyodide in-browser Python) cannot install huggingface-hub<1.0,>=0.33.5 because it cannot find a compatible wheel for that platform. (GitHub)
You might not be using Pyodide, but it demonstrates that “no matching distribution” can be platform-related, not just version-related.
3) Fast fixes (pick the direction that matches your intent)
Fix path 1: You want Gradio 5.44.0 (most common)
Do this:
-
Use Python ≥ 3.10 in the environment (Docker base image, venv). Gradio requires it. (PyPI)
-
Do not pin
huggingface-hub==0.24.0. It is incompatible withgradio 5.44.0’s requirement>=0.33.5. (GitHub) -
If you need a pin for reproducibility, pin in the compatible range instead:
huggingface-hub>=0.33.5,<1.0(matches the Gradio constraint shown in Gradio’s issue) (GitHub)
In other words, align your pin with the tightest downstream requirement.
Fix path 2: You must keep huggingface-hub==0.24.0 (compat / API break reasons)
Then you cannot keep Gradio 5.44.0 in the same environment, because it forces hub ≥ 0.33.5.
Options:
- Downgrade Gradio to a version whose dependency range allows hub 0.24.0.
- Or remove Gradio from this environment and run it in a separate service/container.
This is not theoretical. People hit the same kind of “Gradio bumps huggingface-hub and breaks other packages” conflict in practice (example: Gradio vs LlamaIndex hub constraints). (Hugging Face Forums)
Fix path 3: You do not care about exact versions, you just want “a working set”
Stop pinning transitive deps. Let pip choose:
- Remove the explicit
huggingface-hub==...line. - Prefer only pinning your top-level libraries (transformers, diffusers, gradio) and let their tested ranges settle the rest.
This reduces self-inflicted conflicts dramatically.
4) Robust fixes (so you stop rediscovering this in every rebuild)
Use a lockfile workflow instead of hand-pinning everything
Pip explicitly recommends using constraint files or lockfiles to avoid doing expensive, failure-prone resolution at deploy time. (pip)
Two common approaches:
- pip-tools (
pip-compile) to generate a fully pinned lock file from a small input set. (pip-tools) - uv lock/compile flows (fast resolver, lockfile-style workflows). (Astral Docs)
Use constraints files correctly
Pip supports -c constraints.txt to force versions without listing them as direct requirements. This is useful when you want “always keep hub in X range” across many installs. (pip)
Constraints are conceptually “version limits,” not “things to install.” (Stack Overflow)
5) Minimal diagnostic checklist (to identify which “no matching distribution” cause you have)
Inside the same environment where it fails:
- Print Python version. If < 3.10 and you install Gradio 5.x, you are off-spec. (PyPI)
- Confirm your index. Are you using PyPI or a mirror. Mirrors often lag.
- Check whether pip is skipping candidates due to
Requires-Python. The packaging spec explains how this metadata works and why installers ignore incompatible distributions. (Python Packaging) - If you are in a constrained platform (WASM, slim embedded environments), expect wheel availability constraints similar to the Gradio Playground/Pyodide case. (GitHub)
6) Similar cases and good references (curated)
- Pip’s official “Dependency Resolution” and “Dealing with dependency conflicts.” (pip)
- Pip user guide section that discusses constraints files. (pip)
- Pip CLI docs for
-c/--constraint. (pip) - Python packaging spec for
Requires-Python(why “no matching distribution” happens). (Python Packaging) - pip-tools docs (generate lockfiles with
pip-compile). (pip-tools) - uv docs on locking/compiling environments. (Astral Docs)
- Gradio issue showing the
huggingface-hub<1.0,>=0.33.5constraint and an environment where no compatible wheel can be found (platform example). (GitHub) - Hugging Face forum thread showing real-world Gradio ↔ hub conflicts with other ML stacks. (Hugging Face Forums)
- Gradio’s PyPI page stating Python 3.10+ requirement (high-signal “why my build fails on older Python” clue). (PyPI)
Notes on “io.EOF / cache miss”
That phrase usually comes from the container build layer system, not pip’s resolver. It can coexist with the pip failure, but it is not the cause of ResolutionImpossible. Fix the dependency constraints first.
Summary
- Your pin
huggingface-hub==0.24.0conflicts with Gradio 5.44.0 which requireshuggingface-hub>=0.33.5. (GitHub) - The “no matching distributions” add-on usually means Python version, platform, or package index mismatch. Gradio 5.x requires Python 3.10+. (PyPI)
- Fix by either (a) upgrading hub into
>=0.33.5,<1.0and using Python ≥ 3.10, or (b) downgrading/removing Gradio, or (c) splitting environments. - For long-term stability, generate lockfiles with pip-tools or uv, or use constraints files. (pip-tools)