-1

I am trying to install opencv on my raspberry pi 5 (os: 32-bit lite).

I've tried the code to install opencv:

sudo apt-get install python3-opencv -y 

but encounter the error below:

The following packages have unmet dependencies: python3-opencv : Depends: python3 (< 3.10) but 3.11.2-1 is to be installed Depends: python3-numpy (>= 1:1.16.0~rc1) but it is not going to be installed Depends: python3-numpy-abi9 Depends: libopencv-contrib4.5 (>= 4.5.1+dfsg) but it is not going to be installed Depends: libopencv-highgui4.5 (>= 4.5.1+dfsg) but it is not going to be installed Depends: libopencv-imgcodecs4.5 (>= 4.5.1+dfsg) but it is not going to be installed Depends: libopencv-videoio4.5 (>= 4.5.1+dfsg) but it is not going to be installed E: Unable to correct problems, you have held broken packages. 

How do I fix this?

4
  • 1
    Why are you attempting to use a 32 bit OS on a 64 bit system? It is unclear how you actually managed to do this. Also forget apt-get use apt (unless you are scripting and prepared to handle exceptions) Commented Jun 2 at 13:34
  • i was recommended to use 32 bit because it is more stable and can more easily use library of gpio. i want to install opencv for running some computer version project on raspberrypi Commented Jun 2 at 15:00
  • You were misinformed. The 64 bit OS uses standard Debian code except for Pi specific hardware. This all has to be rewitten on 32 bit. There is no difference in GPIO (although GPIO support on Pi5 is poor due to hardware changes). Commented Jun 2 at 22:40
  • 1
    Just install the normal OS. Commented Jun 2 at 22:41

1 Answer 1

0

It seems to me that the error is telling you what the problem is

 python3 (< 3.10) but 3.11.2-1 

This means the python3-opencv package requires a Python version less than 3.10. Since your system has Python 3.11.2, it doesn't meet this requirement.

You need to update the package lists, like this perhaps

sudo apt update sudo apt upgrade -y sudo apt install python3-pip python3-dev python3-numpy -y 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.