fix(cv): fully purge base OpenCV before reinstalling opencv-python#42
Merged
Conversation
The first attempt (uninstall + force-reinstall) failed the build-time assert on arm64: the nvcr `opencv` and the `opencv-python` wheel share the same site-packages cv2/ directory, so a plain uninstall left residual files that kept shadowing the wheel — `import cv2` still resolved to the headless build (FFMPEG: NO). Confirmed on the real arm64 node: a clean opencv-python 4.13 install reports FFMPEG: YES (the aarch64 wheel does ship FFmpeg), and site-packages held both opencv-4.10.0.dist-info and opencv_python-4.11.0.86.dist-info pointing at one cv2/ dir. Fix: uninstall every opencv variant, then rm -rf the leftover cv2/ dir, opencv*.dist-info, and opencv_python.libs before a clean opencv-python install. Works on amd64 and arm64; the FFmpeg assert still guards regressions. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.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.
Follow-up to #41, which failed the base build on arm64.
Why #41 failed
The nvcr
opencvpackage and theopencv-pythonwheel install into the samesite-packages/cv2/directory. A plainpip uninstall+ reinstall left residual files, soimport cv2still loaded the headless build (FFMPEG: NO) and the build-time assert correctly failed.Confirmed on the real arm64 (spark) node: a clean
opencv-python4.13 install reportsFFMPEG: YES— the aarch64 wheel does ship FFmpeg. The site-packages held bothopencv-4.10.0.dist-infoandopencv_python-4.11.0.86.dist-infoover onecv2/dir.Fix
Uninstall every opencv variant, then
rm -rfthe leftovercv2/,opencv*.dist-info, andopencv_python.libs, then installopencv-pythonclean. Arch-agnostic; the FFmpeg assert still guards against regressions.🤖 Generated with Claude Code