ev3dev / ev3dev-lang-python

Pure python bindings for ev3dev
MIT License
422 stars 146 forks source link

install opencv in ev3dev #794

Open dkasnesis opened 1 year ago

dkasnesis commented 1 year ago

I have Windows 10, latest ev3dev version installed in EV3. I am using Visual Studio Code to program the robot. EV3 is connected to Internet through microUSB cable and everything works nice with SSH. I am trying to install OpenCV library to ev3dev using the terminal and I get this error:

The following packages have unmet dependencies:
 python3-opencv : Depends: libopencv-calib3d3.2 (= 3.2.0+dfsg-4ev3dev1) but it is not going to be installed
                  Depends: libopencv-features2d3.2 (= 3.2.0+dfsg-4ev3dev1) but it is not going to be installed
                  Depends: libopencv-highgui3.2 (= 3.2.0+dfsg-4ev3dev1) but it is not going to be installed
                  Depends: libopencv-imgcodecs3.2 (= 3.2.0+dfsg-4ev3dev1) but it is not going to be installed
                  Depends: libopencv-objdetect3.2 (= 3.2.0+dfsg-4ev3dev1) but it is not going to be installed
                  Depends: libopencv-stitching3.2 (= 3.2.0+dfsg-4ev3dev1) but it is not going to be installed
                  Depends: libopencv-superres3.2 (= 3.2.0+dfsg-4ev3dev1) but it is not going to be installed
                  Depends: libopencv-videoio3.2 (= 3.2.0+dfsg-4ev3dev1) but it is not going to be installed
                  Depends: libopencv-videostab3.2 (= 3.2.0+dfsg-4ev3dev1) but it is not going to be installed
                  Depends: libopencv-viz3.2 (= 3.2.0+dfsg-4ev3dev1) but it is not going to be installed
                  Depends: python3-numpy (>= 1:1.10.0~b1) but it is not installable
                  Depends: python3-numpy-abi9 but it is not installable
                  Depends: libopencv-contrib3.2 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

So I can't make a project that combines opencv and ev3dev. Any help ?

dlech commented 1 year ago

Since Debian stretch is so old now, the package archive URL that ships with ev3dev no longer works. It can be fixed by editing /etc/apt/sources.list (e.g. sudo nano /etc/apt/sources.list) to look like this.

deb http://archive.debian.org/debian stretch main contrib non-free
#deb-src http://archive.debian.org/debian stretch main contrib non-free

deb http://archive.ev3dev.org/debian stretch main
#deb-src http://archive.ev3dev.org/debian stretch main

Then run sudo apt update.