conda-forge/opencv-feedstock

pip metadata files not installed when opencv is installed by conda-forge

traversaro opened this issue · 5 comments

When the opencv conda-forge package is installed, the opencv-python is not listed by pip list .

This is not problematic until a user tries to install a Python library that depends on opencv-python via pip install . . In that case, the OpenCV Python package already available in the conda environment is ignored, and the PyPI opencv-python is installed itself.

Even if the users tries to install the library that depends on opencv-python with pip install --no-deps ., then pip check would fail with:

libraryname 0.1.0 requires opencv-python, which is not installed.

see conda-forge/staged-recipes#18029 (comment) for an example of this issue.

This happens as the Python bindings are installed directly by the CMake build system, that does not have any logic to install the metadata files required by pip:

An example of PR that fixes this issue for another package is conda-forge/casadi-feedstock#59.

Unfortunately, I've known about this issue for quite some time and i really don't know how to solve it.

If you could find a way to solve it that would be great! You could make a pull request and i would review it.

Unfortunately, I've known about this issue for quite some time and i really don't know how to solve it.

If you could find a way to solve it that would be great! You could make a pull request and i would review it.

Sure! I wanted to first make sure we were aligned on the fact that this is a problem to solve.

A PR for this is provided in #300, it includes also a test (at least on Unix) so we can check if it is working as intended.

I did not realized that there was already a PR in #275 .

Yeah, that was my attempt, and I gave up. Please do try to take it on! Feel free to use the flags I've identified as your own in #300