EdjeElectronics/TensorFlow-Object-Detection-on-the-Raspberry-Pi

OpenCV install fails

technotrope opened this issue · 4 comments

(This is my first post, so please let me know if I should be following some other protocol. Thanks.)

While following the guide (Many thanks for putting this guide together, BTW), I get the following error on the "pip3 install opencv-python" command:

Could not find a version that satisfies the requirement opencv-python (from versions: )
No matching distribution found for opencv-python

Any suggestions as to a solution?

This happened to me too, and I think it's something to do with the latest OpenCV distribution in PyPi (pip). Try using the following command instead of the pip-based command. Let me know if it works!

Edit for future readers: this doesn't work! apt-get will install it for Python 2.7 which isn't what we're using.

sudo apt-get install python-opencv

Well, while following about 10 totally different blogs, I somehow managed to get it to work. However, I can't say what finally did the trick. There seems to be as many ways to do ANYTHING on the raspberry pi as there are people writing blogs! LOL Anyway, many thanks for your instructions.

Now that I THINK I have everything installed, I plan to see if I can use your instructions to detect when pesky raccoons are frolicking in my koi pond. Wish me luck, and many thanks.

Haha yes, there's definitely plenty of ways to skin a cat when it comes to the Raspberry Pi. I was facing this same issue when trying to get everything set up on my new Raspberry Pi 4. The issue was caused by the fact that the piwheels repository (which is where "pip3 install opencv-python" downloads the install package from) doesn't have a Python 3.7 version of OpenCV-Python.

Raspberry Pi 4 only has Python 3.7, so it gives the "Could not find a version that satisfies the requirement opencv-python" error. I had to build OpenCV from source using this guide.