docling-project / docling-project/docling

docling v2.56.0+ enforces installation of opencv-python instead of opencv-python-headless

Open
#3,528 9 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
66.4k
Forks
4.8k
Avg merge
2d 21h
Merged PRs (30d)
84

Description

### Bug

Before the v2.56.0 release of docling, the `opencv-python-headless` would be installed by default.
However, since v2.56.0 (still true for v2.96.1), this now installs `opencv-python`, which is not compatible with Docker containers.
This renders Docling completely unusable within Docker containers, as environment management tools like Poetry or uv will not allow you to change the `opencv-python` requirement to `opencv-python-headless`.
Installing `opencv-python-headless` as well also makes an invalid environment, as both packages are incompatible with each other (which is also unacceptable, but not docling's fault).

This [FAQ entry](https://docling-project.github.io/docling/faq/#i-get-this-error-importerror-libglso1-cannot-open-shared-object-file-no-such-file-or-directory) suggests that the team is fully aware of this problem, but has not actually fixed it yet.
Enforcing within a Docker container to, after Poetry/ov has performed an installation, manually uninstall `opencv-python` and install `opencv-python-headless`, is a security risk and completely removes the entire point of using Poetry/uv in the first place.
Making manual changes to Python environment installations is strongly discouraged and should never be done.
Thus, this is an unacceptable solution.

Can this problem be fixed where the installation of `docling` can be told to use the headless version and never even attempt to install the normal `opencv-python` version?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.