Skip to content

Fix Docker build: add --system to uv pip uninstall opencv-python - #2272

Merged
araffin merged 2 commits into
DLR-RM:masterfrom
nikolauspschuetz:fix/dockerfile-uv-uninstall-system
Jul 24, 2026
Merged

araffin merged 2 commits into
DLR-RM:masterfrom
nikolauspschuetz:fix/dockerfile-uv-uninstall-system

Conversation

@nikolauspschuetz

Copy link
Copy Markdown
Contributor

Description

Adds the missing --system flag to the uv pip uninstall opencv-python step in the Dockerfile.

Every other uv pip call in that RUN already passes --system, but the uninstall does not. Recent uv versions require --system for uninstall too when operating outside a virtual environment, so the Docker build now fails at that step:

error: No virtual environment found; run `uv venv` to create an environment,
or pass `--system` to install into a non-virtual environment

This breaks make docker-cpu / make docker-gpu and the docs image for anyone building with a current uv. The .[extra,tests,docs] install itself succeeds — only the subsequent uninstall fails.

Motivation and Context

The Docker image build is currently broken with recent uv. One-line fix, verified by building the image end-to-end (docker build . succeeds; import stable_baselines3 and the vec-env tests run in the resulting image).

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (update in the documentation)

Checklist

  • I've read the CONTRIBUTION guide (required)
  • I have updated the changelog accordingly (docs/misc/changelog.md) (required).
  • My change requires a change to the documentation.
  • I have updated the tests accordingly (required for a bug fix or a new feature).
  • I have updated the documentation accordingly.
  • I have reformatted the code using make format (required)
  • I have checked the codestyle using make check-codestyle and make lint (required)
  • I have ensured make pytest and make type both pass. (required)
  • I have checked that the documentation builds using make doc (required)

Disclosure (per CONTRIBUTING): found and fixed with AI assistance while building the dev image; the diagnosis (missing --system on the uninstall) was verified by reproducing the failing build and rebuilding green.

Every other uv pip call in the Dockerfile RUN passes --system, but the
opencv-python uninstall did not. Recent uv versions require --system for
uninstall too outside a virtualenv, so the image build fails there with
'No virtual environment found'. The .[extra,tests,docs] install succeeds;
only the subsequent uninstall breaks. Verified by rebuilding the image
end-to-end.
@araffin araffin added the LLM generated We do not accept LLM generated issues/PR, please tell your human label Jul 24, 2026
@araffin
araffin marked this pull request as ready for review July 24, 2026 06:48
@araffin
araffin merged commit 06f6135 into DLR-RM:master Jul 24, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LLM generated We do not accept LLM generated issues/PR, please tell your human

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants