Search code examples
opencvgoogle-coral

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


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


Solution

  • Following steps have to be done:

    1. If you have a fresh image make sure you update your system packages

      sudo apt-get update
      sudo apt-get dist-upgrade
      
    2. Install OpenCV

      sudo apt install python3-opencv
      
    3. Test installation

      python3 -c 'import cv2; print(cv2.__version__)'
      

    I can confirm, that openCV can be installed using sudo apt install python3-opencv. If it does not work, check if your board is connected to the internet (see coral documentation here).