0

I have been trying out some OpenCv snippets as part of a larger robotics project such as Face Detection and Face Recognition. These have all been working on my MacBook. I am now trying to test out these programs on my Raspberry Pi running Bullseye on a PINN Lite setup.

I have been searching, finding and following various guides on how to install OpenCV correctly, but keep running into problems during installation. When I finally get an install working I then get problems importing cv2, either with numpy or pandas.

I am now following this guide:

enter link description here

I am now trying to install using this command:

pip install opencv-python

And noticed after removing the apt version of OpenCV and installing OpenCV through pip, it did not install a newer version of numpy suggesting that a version already existed from opencv-python 1.26.2.

Anyway here is the current output and it always seems to get stuck on

Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting opencv-python
Using cached opencv-python-4.8.1.78.tar.gz (92.1 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy>=1.19.3 in ./.local/lib/python3.9/site-packages (from opencv-python) (1.26.2)
Building wheels for collected packages: opencv-python
Building wheel for opencv-python (pyproject.toml) ... -

This is where it gets stuck?

Any help would be great.

asked Dec 18, 2023 at 20:11
4
  • 2
    Does this answer your question? Can't install Opencv on raspberry pi 4 Commented Dec 18, 2023 at 23:29
  • Not really - I seem to be going around in an infinite loop. Following the link you supplied I installed opencv using sudo apt install python3-opencv. Commented Dec 19, 2023 at 13:03
  • Nope - I am going around in an infinite loop. Following the link I installed opencv using sudo apt install python3-opencv. I then re-ran my program and receive this warning: ImportError: this version of pandas is incompatible with numpy < 1.22.4 your version is 1.19.5. Please upgrade numpy to >= 1.22.4. I then ran pip install numpy --upgrade and then when running my program I get an error with libopenblas.so.0: cannot open shared object file: no such file or directory. I then followed a fix to resolve this which ends up downgrading numpy to 1.19 again and then I'm back with the numpy error. Commented Dec 19, 2023 at 13:23
  • If you have run pip you have broken something. DO NOT use pip; get rid of what you installed (or restore from your backup) then install from apt (like the rest of us). Commented Dec 19, 2023 at 21:00

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

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.