opencv / opencv/opencv-python

avoiding multiple PIP packages installation

Open
#677 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
5.4k
Forks
1k
Avg merge
22h 17m
Merged PRs (30d)
3

Description

Hey guys! A bit confused on how to properly set a PIP dependency for my package if it depends on OpenCV. README clearly states:

There are four different packages (see options 1, 2, 3 and 4 below) and you should SELECT ONLY ONE OF THEM.

implying
opencv-python
opencv-contrib-python
opencv-python-headless
opencv-contrib-python-headless

Say I have opencv-contrib-python-headless installed in my environment, and then I install pip package that depends on opencv-python-headless. Even though it can perfectly fine work with (and supposed to) opencv-contrib-python-headless, pip still gonna install opencv-python-headless breaking aforementioned rule.

How to handle that? What should that package set as a dependency to install opencv only if neither packages installed

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the README section describing the four mutually exclusive packages and review how the project publishes opencv-python, opencv-contrib-python, and their headless variants. Investigate whether pip dependency metadata can express the requested alternatives; done would mean documenting or implementing a way to avoid installing a second OpenCV package when one compatible variant is already present.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.