fix(docker): install python3-venv so ensurepip fallback works#36905
Merged
benbarclay merged 1 commit intoJun 2, 2026
Merged
Conversation
ridloabelian
pushed a commit
to ridloabelian/agen-saif
that referenced
this pull request
Jun 2, 2026
Upstream PR NousResearch#36905 (docker python3-venv fix) was authored with alaamohanad169@gmail.com. Add the mapping to unblock check-attribution CI. https://claude.ai/code/session_01Mo8rVq1fhAKxJUYNHaoVsC
changman
pushed a commit
to changman/hermes-agent
that referenced
this pull request
Jun 10, 2026
…ousResearch#36813) (NousResearch#36905) Co-authored-by: alaamohanad169-ship-it <alaamohanad169-ship-it@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #36813
Summary
The Hermes Agent Docker image (Debian 13 trixie) was missing the
python3-venvapt package, which is what ships theensurepipstdlib module. Hermes' lazy-deps installer uses a uv → pip → ensurepip install ladder, and the Tier-2 fallback path callspython3 -m ensurepip --upgrade --default-pipto bootstrap pip into the user venv when uv is unavailable. Withoutpython3-venvinstalled at build time, that command returns exit status 1 and the user gets the confusing error quoted in #36813 (pip not available and ensurepip failed: Command '...python3 -m ensurepip --upgrade --default-pip' returned non-zero exit status 1.) the first time any tool needs a lazily-installed Python dep.This PR adds
python3-venvto the singleapt-get installline in the runtime stage, right afterpython3-dev, so the existing layer still installs everything in one shot. No new RUN layer, no new package manager call, no source code changes.Diffstat
Repro / Verification
Issue #36813 (manual repro from the bug report):
docker pull nousresearch/hermes-agent:latestweb_search()orweb_extract()— firecrawl). Tier-1 uv path can be forced to fail by stripping it from PATH or by setting the env var the lazy-deps installer honors to disable uv.ensurepip failederror.After this fix:
docker build -t hermes-agent:test -f Dockerfile .docker run --rm -it hermes-agent:test bashpython3 -m ensurepip --version→ should print a pip version (e.g.ensurepip (Python 3.13.5)).python3 -c "import venv; venv.ensurepip"to confirm the venv module's bundled pip-bootstrap helper resolves. Both should succeed where the unpatched image fails withNo module named 'ensurepip'.This PR was authored from an environment without a Docker daemon (Termux on Android 16), so the build itself was not run locally; verification is the manual steps above. The CI
docker-lint(hadolint) anddocker-publish(build + smoke test) workflows exercise the patched Dockerfile on the PR branch.Checklist
./Dockerfile, the only Dockerfile referenced bydocker-publish.yml,docker-compose.yml, anddocker-compose.windows.yml).Dockerfile.apt-get installline in the runtime stage; no new RUN, no new layer.python3-dev.scripts/install.sh), or unrelated docs touched.python3-venvaddition.