0

I am an absolute noob at this since I started recently. I am installing OpenCV for Tensorflow for a project. How To Run TensorFlow Lite on Raspberry Pi for Object Detection is the video i am using. I have Bookworm installed, on a Raspberry Pi 5

pip3 install opencv-python==3.4.11.41 is the command that I am running, although I get this error:

 [end of output]
 
 note: This error originates from a subprocess, and is likely not a problem with pip.
 error: legacy-install-failure
 
 ×ばつ Encountered error while trying to install package.
 ╰─> numpy
 
 note: This is an issue with the package mentioned above, not pip.
 hint: See above for output from the failure.
 [end of output]
 
 note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-e×ばつ pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

I have tried almost all the random solutions on the web, I have tried sudo apt-get, pip3, although nothing is working.

Greenonline
2,9725 gold badges27 silver badges38 bronze badges
asked Sep 6, 2024 at 15:29
1
  • The problem seems to be more with NumPy rather than OpenCV... Commented Sep 6, 2024 at 15:48

1 Answer 1

1

At a guess, as you don't specify, you are probably using Python 3.7.

opencv-python 3.4.11.41 doesn't provide wheels for Python 3.7, at most 3.6. As OpenCV will have a dependancy on NumPy, the versions are probably mismatched, leading to the numpy error during the install.

For such an old version of opencv-python either:

A much better solution would be to use the latest version of opencv-python. That video is over four years old, and so the versions used are probably out-of-date, or no longer supported. Just use the latest (compatible) versions of the software.

So enter instead, without the version requirements:

pip3 install opencv-python

Further reading

answered Sep 6, 2024 at 16:52

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.