Describe the bug
The version 4.13.0.90 of opencv-python-headless fails to import in minimal environments (like a Docker python:slim container) due to an undeclared dependency on the system library libxcb1. This was not a requirement in the previous version (4.12.0.88), making it a regression for headless environments.
To reproduce
- Create a
Dockerfile with the following content.
FROM python:3.13.8-slim
WORKDIR /app
COPY test.py .
RUN pip install --no-cache-dir opencv-python-headless==4.13.0.90
CMD ["python", "test.py"]
- Create a
test.py with the following content.
try:
import cv2
print('Import succeded')
except Exception as e:
print(f'Error importing cv2: {e}')
- Build and run the container.
docker build -t opencv-test . && docker run opencv-test
Expected behavior
The opencv-python-headless package should import successfully in a minimal environment without graphical system dependencies like libxcb1, as it did in version 4.12.0.88.
Actual behavior
Whith opencv-python-headless==4.13.0.90 the import fails with error.
libxcb.so.1: cannot open shared object file: No such file or directory
Workaround
Installing the system package libxcb1 (apt-get install libxcb1) or pinning the dependency to a previous version (opencv-python-headless<4.13.0.90) resolves the issue.
Environment
- OpenCV version: 4.13.0.90 (specifically
opencv-python-headless)
- Base image/tested on: python:3.13.8-slim (Official Docker image)
- OS/Platform: Docker Engine on WSL2 / Windows (but the issue is inherent to the Python package)
Describe the bug
The version
4.13.0.90ofopencv-python-headlessfails to import in minimal environments (like aDockerpython:slimcontainer) due to an undeclared dependency on the system librarylibxcb1. This was not a requirement in the previous version (4.12.0.88), making it a regression for headless environments.To reproduce
Dockerfilewith the following content.test.pywith the following content.Expected behavior
The
opencv-python-headlesspackage should import successfully in a minimal environment without graphical system dependencies likelibxcb1, as it did in version4.12.0.88.Actual behavior
Whith
opencv-python-headless==4.13.0.90the import fails with error.Workaround
Installing the system package
libxcb1(apt-get install libxcb1) or pinning the dependency to a previous version (opencv-python-headless<4.13.0.90) resolves the issue.Environment
opencv-python-headless)