From 3188cd26592c6adac837af3f00b79b6db5348092 Mon Sep 17 00:00:00 2001 From: "E.G" <146701565+GlobalStar117@users.noreply.github.com> Date: Mon, 19 Jan 2026 19:08:14 +1100 Subject: [PATCH] fix: Ensure pip is available in venv for runtime installation (#12667) ## Summary Fixes #12651 The Docker container was failing at startup with: ``` /ragflow/.venv/bin/python3: No module named pip ``` This occurred when `USE_DOCLING=true` because the `entrypoint.sh` tries to use `uv pip install` to install docling at runtime. ## Root Cause As explained in the issue: 1. `uv sync` creates a minimal, production-focused environment **without pip** 2. The production stage copies the venv from builder 3. Runtime commands using `uv pip install` fail because pip is not present ## Solution Added `python -m ensurepip --upgrade` after `uv sync` in the Dockerfile to ensure pip is available in the virtual environment: ```dockerfile uv sync --python 3.12 --frozen && \ # Ensure pip is available in the venv for runtime package installation (fixes #12651) .venv/bin/python3 -m ensurepip --upgrade ``` This is a minimal change that: - Ensures pip is installed during build time - Doesn't change any other behavior - Allows runtime package installation via `uv pip install` to work --- This is a Gittensor contribution. gittensor:user:GlobalStar117 Co-authored-by: GlobalStar117 --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 75df15492..47ef161e4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -154,7 +154,9 @@ RUN --mount=type=cache,id=ragflow_uv,target=/root/.cache/uv,sharing=locked \ else \ sed -i 's|pypi.tuna.tsinghua.edu.cn|pypi.org|g' uv.lock; \ fi; \ - uv sync --python 3.12 --frozen + uv sync --python 3.12 --frozen && \ + # Ensure pip is available in the venv for runtime package installation (fixes #12651) + .venv/bin/python3 -m ensurepip --upgrade COPY web web COPY docs docs