I am using Raspbian Stretch on my RPi 3, I wanted to install OpenCV on it.
I did this before by following the instructions detailed here .
The problem is that this takes a very long time.
Lately, I've been looking in the internet, so I found in this link that installing Opencv only needs to run these commands pip install opencv-python
and pip install opencv-contrib-python
. I tried it on Ubuntu with my PC and it worked well.
So my question is: is it possible to install Opencv on a RPi 3 by just running these commands instead of compiling it from source?
-
I really do not know , my fault, how to respond, but who or what is stopping you to try it ? Secondly - if the "manual: states it will take OpenCV time to install due to dependencies - why cannot just accept that?Jan Hus– Jan Hus2018年08月30日 13:58:53 +00:00Commented Aug 30, 2018 at 13:58
-
Unfortunately, it is a bit late now.. I am already in the last step of the 'usual' method which is compiling from source. So at least I have to wait till it finishes to try this one.singrium– singrium2018年08月30日 14:02:22 +00:00Commented Aug 30, 2018 at 14:02
-
Have you favorite snack / beverage in the meantime. CheersJan Hus– Jan Hus2018年08月30日 14:03:28 +00:00Commented Aug 30, 2018 at 14:03
-
As I read in this link: raspberrypi.stackexchange.com/questions/77307/…, precompiled binaries work only for some specific architectures (X86 and X86_64 but not ARM), which means that the only available solution to install Opencv on RPi is to compile it from source.singrium– singrium2018年08月30日 14:12:03 +00:00Commented Aug 30, 2018 at 14:12
-
1@singrium: precompiled wheels of opencv-python and opencv-contrib-python for arm / python 3 are available from piwheels (www.piwheels.org)Dirk– Dirk2018年08月30日 14:21:59 +00:00Commented Aug 30, 2018 at 14:21
1 Answer 1
Precompiled wheels of opencv-python and opencv-contrib-python for arm / python 3 are available from piwheels (www.piwheels.org). On current Raspbian Stretch this already pre-configured.
On other distros (such as Raspbian Jessie) it can easily be added by creating the file '/etc/pip.conf' containing:
[global]
extra-index-url=https://www.piwheels.org/simple
-
Di you try installing Opencv using piwheels before? As I said before, I am in the last step of compiling Opencv from source and I am afraid that if I abort it now and try piwheels it will not work.singrium– singrium2018年08月30日 15:08:09 +00:00Commented Aug 30, 2018 at 15:08
-
Not 'in anger', meaning I downloaded it, but I cannot test if it's actually working ATM. Maybe you can create a virtual environment and try to download it in that environment.Dirk– Dirk2018年08月30日 15:22:33 +00:00Commented Aug 30, 2018 at 15:22
-
This doesn’t work either; same "no matching distribution error"Noah Pentecost– Noah Pentecost2018年11月22日 20:39:11 +00:00Commented Nov 22, 2018 at 20:39
-
@NoahPentecost on what model Pi / OS + version / Python version? And what is the exact command you use?Dirk– Dirk2018年11月22日 20:57:57 +00:00Commented Nov 22, 2018 at 20:57
-
This worked on a RasPi 3 Model B v1.2, under Stretch. This is a fresh install, and I do not understand the claim that Stretch checks PiWheels out of the box. If really pre-configured, the system images we get are broken. Anyway, thanks @Dirk for compiling a solution (note that this solution checks PiWheel after, not before PyPi, as expected in some Stretch documentations).Eric Platon– Eric Platon2019年01月30日 00:52:14 +00:00Commented Jan 30, 2019 at 0:52