-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
opencv-python-headless continues to be installed despite meeting MIN_OPENCV_VERSION with opencv-python #1785
Comments
I am not really an expert on how pip handles depencencies, especially dynamic ones. If someone knows how to do it better - would be great. First issue that I see is that pip install albumentations --no-binary albumentations Does not behave as expected and! We do not have a check in CI/CD to check for that. Second is that overall dynamic dependencies do not work as expected. Does this work if write it like
I.e. switch lines? |
Hi, did you instead mean run the installation of albumentations first, followed by installation of opencv-python? |
What about
Could |
just did a quick check and no opencv exists under ros:humble-ros-base. Not even under "apt install" |
Running in docker, I already have opencv-python 4.9.0.80 (pip installed).
I then run
pip install albumentations --no-binary albumentations
so that I can have albumentations WITHOUT opencv-python-headless.Upon pip installation, albumentations (1.4.8) will still (wrongly) install opencv-python-headless (4.10.0.82).
This results in the system having 2 opencv installations (conflict).
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Environment: Ubuntu 22.04, Python 3.10.12, Albumentations 1.4.8
Sample dockerfile to re-enact this bug.
FROM ros:humble-ros-base
RUN apt-get update && apt-get install -y python3-pip
RUN pip install --upgrade pip
RUN pip install opencv-python==4.9.0.80
RUN pip install albumentations --no-binary albumentations
It doesn't say error, but it will just wrongly install opencv-python-headless 4.10.0.82, despite already having the opencv-python 4.9.0.80 which meets the min opencv version. This dual installation of cv2 will result in my image having a headless version dominating, hence blocking my other programs that would need an opencv with gui capabilities.
Expected behavior
This argument (no binary) of pip installation of albumentations is supposed to NOT install opencv-python-headless, i.a.w. https://albumentations.ai/docs/getting_started/installation/.
Actual behavior
In the end, 2 conflicting versions of opencv exists.
pip list |grep open
opencv-python 4.9.0.80
opencv-python-headless 4.10.0.82
Additional context
For me, I can't live with using a headless opencv in this docker image. During the development stage, I require plenty of testing (visually checking the images, most commonly using cv2.imshow) using GUI. This installation of opencv-python-headless when pip installing Albumentations is causing me the inability to use opencv's GUI. (not really keen on using QT's gui just to display an image).
Oh yah, in case anyone wants to know. If I have opencv-python 4.10.0.82 installed, and then
pip install albumentations --no-binary albumentations
, it will not install the opencv-python-headless.For argument sake, i would like to just use 4.9.0.80 or an even lower version like 4.6.0.66 of opencv-python
The text was updated successfully, but these errors were encountered: