Description
The current practice of specifying a requirement for opencv-python-headless
causes conflicts for other installations of OpenCV. For example, if a user requires modules from opencv-contrib-python
that are not available in opencv-python-headless
but they install imgaug
, pip
will install both versions and thusly have conflicting versions of OpenCV with different features. To do this, I have to do:
pip install imgaug
pip uninstall -y opencv-python-headless
pip install opencv-contrib-python-headless
It seems this problem was contemplated in #324 so I suppose I'm just here to confirm those fears are well-founded.
From what I can tell, imgaug
supports any of the four opencv-*-python-*
flavors. In light of that, I humbly propose the following as options (with a preference for the first):
- Removing
opencv-*-*
from theinstall_requires
insetup.py
. This is the simplest option and is compatible with the current installation instructions in the README which ask the user to install OpenCV on their own first. It is at this point that the user could choose the OpenCV flavor that makes sense for their application. - Implementing more logic to check for existing OpenCV versions. I think this will be kind of a pain but is what
scikit-image
seems to do and it may create problems for people who use package management systems likepipenv
orpoetry
where package installation sequence is ill-defined. It also will have sequencing issues for users who build their own customized versions ofopencv-python
in order to use non-free algorithms in OpenCV.
I will gladly submit a PR for this if the relevant folks agree this is okay. Thanks!