`pip install inference` installs three OpenCV distributions; `easyocr` pulls an unpinned `opencv-python-headless` 5.0 that competes with the pinned 4.x `cv2`
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start with requirements/_requirements.txt, inference_models/pyproject.toml, and the existing requirements/requirements.easyocr.txt; compare how OpenCV dependencies are declared and inspect the install paths described in the issue. Reproduce with the Python 3.13 virtual environment commands in the report. Done means the chosen dependency arrangement prevents an unpinned opencv-python-headless release from overriding the supported OpenCV version in a clean install.
Written by the indexing model from the issue text.
Description
What happens
A clean pip install inference (1.7.4, Python 3.13, macOS arm64; same with uv pip install) ends up with three distributions that all own cv2/:
opencv-python 4.11.0.86 <- inference, inference-sdk, inference-models, roboflow-workflows (pinned <4.13 / <=4.13.0)
opencv-contrib-python 4.11.0.86 <- inference (requirements/_requirements.txt, pinned <4.13)
opencv-python-headless 5.0.0.93 <- easyocr 1.7.2 <- inference-models (core dependency, unpinned)
pip/uv treat them as unrelated packages, so all three install and the last one to unpack wins the cv2/ directory. Which one that is depends on resolver and install order:
uv pip install inference:import cv2gives 4.11.0 (the pinned build happened to unpack last).python -m pip install inference:import cv2gives 4.12.0 (same).
So a fresh install currently lands on the pinned 4.x build by luck of ordering. Any later operation that reinstalls headless flips it. For example, after the pip install above:
$ pip install --force-reinstall --no-deps opencv-python-headless==5.0.0.93 # what `pip install -U easyocr` would do
$ python -c "import cv2; print(cv2.__version__)"
5.0.0
$ pip check
No broken requirements found.
import cv2 now returns the headless 5.0 build, the opencv-python<4.13.0 pin added in #2357 (tensor-native Workflows) is silently defeated, and nothing in pip reports a problem because the three distributions are unrelated as far as metadata goes.
Why
inference_models/pyproject.toml lists easyocr~=1.7.2 as a core dependency (since the inference-exp → inference-models rename, 927d6dd24). easyocr depends on opencv-python-headless with no version bound, so it resolves to the newest release, which has been 5.0.0.93 since 2026-07-02.
The repo already recognises this class of problem: requirements/requirements.magevl.txt is installed with --no-deps precisely because "installing headless alongside the opencv-python this repo already pins puts two packages behind cv2", and the Jetson Dockerfiles override opencv-python-headless==4.12.0.88 (#1045). Neither applies to the PyPI install path through inference-models.
Reproduction
python3.13 -m venv v && v/bin/pip install inference
v/bin/pip list | grep -i opencv
v/bin/python -c "import cv2; print(cv2.__version__, hasattr(cv2, 'imshow'))"
Options
- Add
opencv-python-headless>=4.8.1.78,<4.13.0next to the existingopencv-python/opencv-contrib-pythonpins inrequirements/_requirements.txtandinference_models/pyproject.toml, so whichever package winscv2/is at least a supported 4.x build. Smallest change; keeps three packages installed. - Make
easyocran optional extra ofinference-models(it already hasrequirements/requirements.easyocr.txton the inference side), so the default install stops pulling headless at all. - Both.
Happy to open a PR for whichever you prefer.
- Dominant language
- Python
- Stars
- 2.5k
- Forks
- 340
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 92
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from roboflow/inference
-
Allow Pillow 13 in inference-sdkMay be free again A pull request for this issue was closed without being merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
roboflow/inference#3335 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
roboflow/inference#3173 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
roboflow/inference#2993 · 2 comments ·
Maintainers usually reply within 1 day
-
Add context manager (__enter__ / __exit__) support to InferencePipelinePossibly taken @KushagraKanaujia claimed this 67 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
roboflow/inference#2744 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
roboflow/inference#1913 · 1 comment · 2 reactions ·
Maintainers usually reply within 1 day
All issues in roboflow/inference
Similar issues
-
area:core-platform effort:S priority:P3 risk:night-safe status:ready type:test
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
randomparity/kdive#3620 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
FinanceFlash/unvibecode#760 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
google-research/google-research#3470 ·
Maintainers usually reply within 21 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
mrvautin/ha-workouts#11 ·