Fix Docker build: add --system to uv pip uninstall opencv-python - #2272
Merged
araffin merged 2 commits intoJul 24, 2026
Merged
Conversation
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
marked this pull request as ready for review
July 24, 2026 06:48
araffin
approved these changes
Jul 24, 2026
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.
Description
Adds the missing
--systemflag to theuv pip uninstall opencv-pythonstep in theDockerfile.Every other
uv pipcall in thatRUNalready passes--system, but theuninstalldoes not. Recentuvversions require--systemforuninstalltoo when operating outside a virtual environment, so the Docker build now fails at that step:This breaks
make docker-cpu/make docker-gpuand the docs image for anyone building with a currentuv. The.[extra,tests,docs]install itself succeeds — only the subsequentuninstallfails.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_baselines3and the vec-env tests run in the resulting image).Types of changes
Checklist
docs/misc/changelog.md) (required).make format(required)make check-codestyleandmake lint(required)make pytestandmake typeboth pass. (required)make doc(required)Disclosure (per CONTRIBUTING): found and fixed with AI assistance while building the dev image; the diagnosis (missing
--systemon theuninstall) was verified by reproducing the failing build and rebuilding green.