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-error

× 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.

1
  • The problem seems to be more with NumPy rather than OpenCV... Commented Sep 6 at 15:48

1 Answer 1

0

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

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.