0
votes

I'm working on getting OpenCV-Python installed onto a raspberry pi so that I can stream a video from the pi to my computer. I worked on the code in pycharm and got it to work running the .py files both on my computer, but I have been unable to get the file to work on the pi.

The root cause, I think, is that the OS on the pi is old. It's running python3.4 as the default, with pip 1.5 (I think that's right, its been a minute since I checked). When I attempted to run the program the first time, I got the 'no module cv2' error. Fair enough. Tried pip installing OpenCV-Python and everything has been a mess since then. That pip install fails, updating pip breaks pip, I think because python3.4 reached EOL a while ago, so that's a no go. I've tried installing different versions of Python, lots of different things.

Currently, I've got Python 3.6.5 installed. I ran the command to pip install OpenCV-Python there and the pi has been stuck on 'installing build dependencies' for over two hours now.

I realize this has been all over the place, so here's a hopefully concise question.

What do I need to do to get OpenCV-Python running on my raspberry pi?

Do I need a different version of Python? Of Pip? Dependencies? I think NumPy is the only one but I could be wrong. The possibly dumber question, this is possible, right?

A little extra tidbit, the end goal of this is for work, so I have to stay on the same OS image basically. I can install new libraries and versions of Python, but I can't upgrade entirely.

Sorry that this question is so scattered, yeesh. I'm happy to answer questions about the system etc.

1
your installed operating system appears to be damaged and/or outdated. consider fixing the OS, then deal with python, then deal with the opencv-python pip module. - Christoph Rackwitz
@ChristophRackwitz Yeah, I'm talking with my boss to try to make upgrading/fixing the OS a priority. That would make a lot of these problems go away. - Elkelthen

1 Answers

1
votes

the open cv in raspberry pi is a bit tricky. You need to setup the environment for open-cv to function correctly try checking this link its work for me

https://www.learnopencv.com/install-opencv-4-on-raspberry-pi/

PS. Read the comment first the code has some error