When installing opencv, via pip, the downloaded wheel should contain all binary dependencies.
python3 -m pip install --no-cache-dir opencv-python
shell: sh -e {0}
Collecting opencv-python
Downloading opencv_python-4.5.1.48-cp38-cp38-manylinux2014_aarch64.whl (34.5 MB)
Collecting numpy>=1.19.3
Downloading numpy-1.20.2-cp38-cp38-manylinux2014_aarch64.whl (12.7 MB)
Installing collected packages: numpy, opencv-python
Successfully installed numpy-1.20.2 opencv-python-4.5.1.48
echo "import cv2" | python3
shell: sh -e {0}
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.8/dist-packages/cv2/__init__.py", line 5, in <module>
from .cv2 import *
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
Error: Process completed with exit code 1.
python3 -m pip install opencv-pythonecho "import cv2" | python3This can be fixed by adding running auditwheel on the binary wheel after build completion to make in compliant with the spec. This will bundle any dependencies in the wheel and verify that it links against the max versions of system libraries like glibc in order to be broadly compatible.
[x] This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)
[x] I have read the README of this repository and understand that this repository provides only an automated build toolchain for OpenCV Python packages (there is no actual OpenCV code here)
opencv-pythonAuditwheel is already used. Manylinux policy states that libGL.so.1 should not be included (https://github.com/pypa/auditwheel/blob/master/auditwheel/policy/policy.json#L108).
This is stated also by PEP 599: https://www.python.org/dev/peps/pep-0599/#id20
To be exact, manylinux wheels should not include these binaries:
The wheel's binary executables or shared objects may not link against externally-provided libraries except those in the following list:
libgcc_s.so.1
libstdc++.so.6
libm.so.6
libdl.so.2
librt.so.1
libc.so.6
libnsl.so.1
libutil.so.1
libpthread.so.0
libresolv.so.2
libX11.so.6
libXext.so.6
libXrender.so.1
libICE.so.6
libSM.so.6
libGL.so.1
libgobject-2.0.so.0
libgthread-2.0.so.0
libglib-2.0.so.0
Got it. Thanks for posting a link to the spec.