TransWikia.com

OpenCV: Error - Module not found -(on IDLE)

Ask Ubuntu Asked on December 8, 2020

I have installed OpenCV on Ubuntu 18.04. The python installation is using conda(screenshot attached)

I can import OpenCV from terminal and jupyter notebooks import on terminal and work with it.

Now I am using IDLE for my work and, want to import cv2 on it but it is showing "ModuleNotFoundError" on the same code.

To check for installed packages, I tried both pip list (pip package list) and conda list(conda list).

I have also done sudo apt-get install opencv and pip install opencv.

My opinion is that there is some problem with the path and/or environment in which OpenCV is installed(I may be wrong). I couldn’t decipher which file should be placed where to make this work.

In summary:

  1. I have OpenCV installed on my Ubuntu 18.04 system but I am not able to import it on IDLE.
  2. I want to be able to access it from python files created with IDLE.
  3. Please do explain why is this happening in first place and if possible, explain the solution in detail.

Please do write in comment if more information is required(and how can I access it) and I’ll be happy to post it.

Since this is my first question, the site is not allowing me to upload images here and instead, providing links to uploaded images from Imgur. I am sorry for the inconvenience.

Thanks!

One Answer

You need to install opencv-python.

pip3 install opencv-python

Answered by KK Patel on December 8, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP