Problem installing libopencv in 4t-pytorch:r34.1.1-pth1.12-py3

Hi everybody I am trying to install libopencv in nvcr.io/nvidia/l4t-pytorch:r34.1.1-pth1.12-py3
However, I get the following output:

dpkg: error processing archive /tmp/apt-dpkg-install-KGW73W/105-libopencv_4.5.4-8-g3e4c170df4_arm64.deb (--unpack):
 trying to overwrite '/usr/share/opencv4/haarcascades/haarcascade_eye.xml', which is also in package opencv-libs 4.5.0
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Selecting previously unselected package libopencv-dev.
Preparing to unpack .../106-libopencv-dev_4.5.4-8-g3e4c170df4_arm64.deb ...
Unpacking libopencv-dev (4.5.4-8-g3e4c170df4) ...
dpkg: error processing archive /tmp/apt-dpkg-install-KGW73W/106-libopencv-dev_4.5.4-8-g3e4c170df4_arm64.deb (--unpack):
 trying to overwrite '/usr/bin/opencv_annotation', which is also in package opencv-dev 4.5.0
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Selecting previously unselected package libusb-1.0-0-dev:arm64.
Preparing to unpack .../107-libusb-1.0-0-dev_2%3a1.0.23-2build1_arm64.deb ...
Unpacking libusb-1.0-0-dev:arm64 (2:1.0.23-2build1) ...
Selecting previously unselected package libusb-1.0-doc.
Preparing to unpack .../108-libusb-1.0-doc_2%3a1.0.23-2build1_all.deb ...
Unpacking libusb-1.0-doc (2:1.0.23-2build1) ...
Selecting previously unselected package libeigen3-dev.
Preparing to unpack .../109-libeigen3-dev_3.3.7-2_all.deb ...
Unpacking libeigen3-dev (3.3.7-2) ...
Errors were encountered while processing:
 /tmp/apt-dpkg-install-KGW73W/105-libopencv_4.5.4-8-g3e4c170df4_arm64.deb
 /tmp/apt-dpkg-install-KGW73W/106-libopencv-dev_4.5.4-8-g3e4c170df4_arm64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Any ideas in how to solve this issue?
Thanks in advance!

Hi,

It looks like there are already some OpenCV files exist.

Could you share which command you execute?
Have you installed it with sudo?

Thanks.

I run a Dockerfile

FROM 4t-pytorch:r34.1.1-pth1.12-py3
RUN apt-get install libopencv

It seems this NVIDIA Docker image has already installed some opencv packages that are in conflict when installing libopencv

Hi @jnaranjo, yes that container already has OpenCV 4.5 installed that was built with support for CUDA enabled.
If you don’t want that, you can try running this in your Dockerfile instead:

RUN apt-get purge -y '*opencv*' && apt-get install -y libopencv
1 Like

Okey! Thank you so much for the quick reply!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.