opencv
import_error
ai_generated
true
ImportError: libGL.so.1: cannot open shared object file
ID: opencv/import-cv2-failed
85%Fix Rate
88%Confidence
3Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 4 | active | — | — | — |
Root Cause
OpenCV import fails due to missing system libraries.
genericWorkarounds
-
92% success Install headless variant: pip install opencv-python-headless
-
90% success Install missing lib: apt-get install libgl1-mesa-glx
Dead Ends
Common approaches that don't work:
-
Install full OpenCV from source
70% fail
Overkill for missing system lib
-
Symlink random .so files
82% fail
Wrong library version