PIP install issue

I have uploaded file but its showing error

→ ERROR: process “/bin/sh -c pip install --no-cache-dir -r /tmp/requirements.txt” did not complete successfully: exit code: 1

How to resolve this error

1 Like

If I diagnose just by log:


What this log is actually telling you

1) “cache miss …” is not the error

Those lines are Docker/BuildKit progress output saying the builder didn’t reuse cached layers (so it re-ran the steps). Your Space can still succeed with “cache miss” lines. Your page shows the same pattern. (Hugging Face)

2) “Failed to retrieve error logs: SSE is not enabled” means “the UI can’t show the real failure”

SSE = Server-Sent Events (the streaming mechanism Spaces uses to fetch logs). When SSE is “not enabled” (or otherwise unavailable), you often see only the outer build scaffolding, not the actual pip/OS error line. This shows up in unrelated Spaces issues, so it’s commonly a logging/infra limitation, not the root cause. (Hugging Face)


Background: how Gradio Spaces are built (why your output looks like this)

In a Gradio Space, Hugging Face’s build uses a base image and runs steps like:

  1. install a Gradio runtime (plus extras) and “spaces” tooling (your log shows pip install … gradio[oauth,mcp]==6.5.1 … spaces) (Hugging Face)
  2. copy your repo into the container (COPY … /app) (Hugging Face)
  3. install your requirements.txt (pip install -r requirements.txt) (Hugging Face)

If step (3) tries to change core runtime packages (especially gradio), pip can fail or produce a broken environment.


Most likely cause in your repository: Gradio version conflict

Your repo config currently sets Gradio 6.5.1 via the Space YAML:

But your requirements.txt pins Gradio 4.44.0:

That is a direct mismatch. In Gradio Spaces, Hugging Face explicitly documents that the Gradio version should be controlled via sdk_version. (Hugging Face)
And there are forum threads describing how pinning Gradio (or related core deps) in requirements.txt can be overridden or can cause conflicts during rebuilds. (Hugging Face Forums)

What failure would this typically create?

Common outcomes:

  • pip dependency resolution failure (“cannot install X and Y together”, “ResolutionImpossible”, etc.)
  • or pip succeeds but your runtime becomes inconsistent (less common, but worse)

Because your Space can’t stream the real logs (SSE error), you don’t see the exact pip line—but the mismatch above is the most concrete, repo-specific explanation.


Fixes / workarounds (in the order I’d try)

Option A (recommended): Keep Gradio 6.5.1 and remove Gradio from requirements.txt

  1. Edit requirements.txt to remove the gradio==4.44.0 line, leaving only your app deps (pandas/numpy/scikit-learn).
  2. Keep sdk_version: 6.5.1 in README.md.

Why this is the clean path:

  • Gradio Spaces docs: change Gradio version through sdk_version. (Hugging Face)
  • Dependency guidance: use requirements.txt for your packages. (Hugging Face)
  • Community reports: pinning Gradio in requirements can be problematic in Gradio Spaces. (Hugging Face Forums)

Option B: If you want Gradio 4.44.0, make the Space YAML match

Set sdk_version: 4.44.0 in README.md so both YAML and requirements.txt agree. Gradio Spaces are designed for this knob. (Hugging Face)

Option C: Force a clean rebuild when you change dependency strategy

Use “Factory reboot this space” in the Space Settings. This is specifically recommended to rebuild “without using cached requirements.” (Hugging Face Forums)

Option D: Switch to Docker Space if you need total control

If you want deterministic installs (and to avoid managed Gradio install layers), use Docker Spaces (sdk: docker) and manage everything in a Dockerfile. (Hugging Face)


How to diagnose when logs are hidden by the SSE issue

Even without server logs, you can validate the most likely failure locally:

python -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install gradio==6.5.1
pip install -r requirements.txt

If pip errors, you’ll see the exact conflict immediately. (If it succeeds locally, then the next suspect is platform-side/build infra.)

Also: if “SSE is not enabled” persists across restarts/factory reboot, it can be an infra-side issue (multiple users report it independently of their code). (Hugging Face Forums)


After the build succeeds: a runtime error you’ll likely hit next (separate from build)

Your app.py contains invalid Python format specifiers like :.1 f and :.2 f (note the space). That will raise a runtime exception when those strings are formatted. Example lines show ({y.mean()*100:.1 f}%) and {accuracy*100:.2 f}%. (Hugging Face)
Fix: remove the spaces → :.1f, :.2f, :,.2f.


Minimal “do this now” change set

  1. Remove gradio==4.44.0 from requirements.txt. (Hugging Face)
  2. Keep sdk_version: 6.5.1 in README. (Hugging Face)
  3. Factory reboot. (Hugging Face Forums)
  4. Fix :.1 f:.1f etc. in app.py to avoid the next runtime crash. (Hugging Face)