f0cal / google-coral

Community gathering point for Google Coral dev board and dongle knowledge.
109 stars 14 forks source link

ModuleNotFoundError: No module named 'cv2' in google coral mendel 4.0 #59

Closed rahul4tripathi2 closed 4 years ago

rahul4tripathi2 commented 5 years ago

https://coral.withgoogle.com/news/updates-11-2019/

As per above google coral November updates new Mendel 4.0 has the support of OpenCV but when I installed Mendel 4.0 it is unable to import cv2. Please let me know do I've to follow any further steps to install OpenCV in Mendel 4.0

Namburger commented 5 years ago

@rahul4tripathi2

$ sudo apt-get install python3-opencv

should do the trick!

rahul4tripathi2 commented 5 years ago

It is not working!!!

Namburger commented 5 years ago

@rahul4tripathi2 What error are you seeing?

Also, sorry, are you using python2 or python3? With python2 it should be

$ sudo apt-get install python-opencv
rahul4tripathi2 commented 5 years ago

I'm using python3 mendel@purple-dog:~$ sudo apt-get install python3-opencv Reading package lists... Done Building dependency tree... Done E: Unable to locate package python3-opencv

Namburger commented 4 years ago

@rahul4tripathi2 after flashing the board, did you connect it to wifi and update the OS?

$ sudo apt-get update
$ sudo apt-get dist-upgrade

I just re-flashed my board with mendel day and it had no issue installing it:

mendel@wishful-dog:~$ dpkg -s python3-opencv
Package: python3-opencv
Status: install ok installed
Priority: optional
Section: python
Installed-Size: 2509
Maintainer: Debian Science Team <debian-science-maintainers@lists.alioth.debian.org>
Architecture: arm64
Source: opencv
Version: 3.2.0+dfsg-6
Depends: libopencv-calib3d3.2 (= 3.2.0+dfsg-6), libopencv-features2d3.2 (= 3.2.0+dfsg-6), libopencv-flann3.2 (= 3.2.0+dfsg-6), libopencv-highgui3.2 (= 3.2.0+dfsg-6), libopencv-imgcodecs3.2 (= 3.2.0+dfsg-6), libopencv-imgproc3.2 (= 3.2.0+dfsg-6), libopencv-ml3.2 (= 3.2.0+dfsg-6), libopencv-objdetect3.2 (= 3.2.0+dfsg-6), libopencv-photo3.2 (= 3.2.0+dfsg-6), libopencv-shape3.2 (= 3.2.0+dfsg-6), libopencv-stitching3.2 (= 3.2.0+dfsg-6), libopencv-superres3.2 (= 3.2.0+dfsg-6), libopencv-video3.2 (= 3.2.0+dfsg-6), libopencv-videoio3.2 (= 3.2.0+dfsg-6), libopencv-videostab3.2 (= 3.2.0+dfsg-6), libopencv-viz3.2 (= 3.2.0+dfsg-6), python3 (<< 3.8), python3 (>= 3.7~), python3-numpy (>= 1:1.16.0~rc1), python3-numpy-abi9, libc6 (>= 2.17), libgcc1 (>= 1:3.0), libopencv-contrib3.2, libopencv-core3.2, libstdc++6 (>= 5.2)
Description: Python 3 bindings for the computer vision library
 This package contains Python 3 bindings for the OpenCV (Open Computer Vision)
 library.
 .
 The Open Computer Vision Library is a collection of algorithms and sample
 code for various computer vision problems. The library is compatible with
 IPL (Intel's Image Processing Library) and, if available, can use IPP
 (Intel's Integrated Performance Primitives) for better performance.
 .
 OpenCV provides low level portable data types and operators, and a set
 of high level functionalities for video acquisition, image processing and
 analysis, structural analysis, motion analysis and object tracking, object
 recognition, camera calibration and 3D reconstruction.
Homepage: https://opencv.org
rahul4tripathi2 commented 4 years ago

following below link solved my problem https://stackoverflow.com/questions/59066643/modulenotfounderror-no-module-named-cv2-in-google-coral-mendel-4-0/59077513?noredirect=1#comment104510616_59077513