modulenotfounderror no module named cv2

0 votes

Cannot find module cv2 when using OpenCV

I have successfully downloaded the  OpenCV on the Occidentalis operating system which is nothing but a variant of Raspbian on a Raspberry Pi by using the script of jayrambhia which I found here and I have installed version 2.4.5.

While trying to import cv2 in a Python program, I get the following message:

pi@raspberrypi~$ python cam.py 
Traceback (most recent call last) 
File "cam.py", line 1, in <module> 
        import cv2 
ImportError: No module named cv2

The file cv2.so is stored in /usr/local/lib/python2.7/site-packages/… Which means that there are additional folders in /usr/local/lib called python3.2 and python2.6 which will serve as a problem but I'm not sure whether this is a path error. Could I get some help on this please as I am new to Linux?

Feb 8 in Python by Rahul
• 9,680 points
968 views

1 answer to this question.

0 votes

Firstly, please do run these following commands inside the Terminal or CMD:

conda update anaconda-navigator conda update navigator-updater

Following which, the problem for the instruction provided below will be resolved. For a windows system, if one has the anaconda software installed, you can simply try this:- 

pip install opencv-python or conda install -c https://conda.binstar.org/menpo opencv

If you are using the linux software, then you can try:

pip install opencv-python or conda install opencv

Finally, if you are using the anaconda software, then you may simply use this as well excluding the need to add the menpo channel:-
 

conda install -c conda-forge opencv

answered Feb 8 by Soham
• 9,670 points

Related Questions In Python

+2 votes
3 answers

ModuleNotFoundError: No module named 'cv2'

Hi@akhtar, This error may occur if you didn't install ...READ MORE

answered Apr 9, 2020 in Python by MD
• 95,380 points
200,297 views
0 votes
1 answer

ModuleNotFoundError: No module named 'cv2'

Check if it's installed properly, It will work ...READ MORE

answered Oct 12, 2020 in Python by Gitika
• 65,890 points
2,900 views
+1 vote
3 answers
+2 votes
3 answers

ModuleNotFoundError: No module named 'Crypto'

The module you’ve installed is different. To install ...READ MORE

answered Aug 20, 2019 in Python by Raman
58,353 views
0 votes
1 answer
0 votes
2 answers

ModuleNotFoundError: No module named 'pythoncom' in pyttsx3

even i faced the same problem ...just ...READ MORE

answered Jun 2, 2020 in Python by anonymous
9,692 views
0 votes
1 answer

Cannot find module cv2 when using OpenCV

This is because python is not able ...READ MORE

answered Apr 30 in Other DevOps Questions by narikkadan
• 37,660 points
106 views
0 votes
1 answer

Section postgresql not found in the database.ini file

Python doesn't know what $FILEDIR is. Try an absolute path ...READ MORE

answered Oct 3, 2018 in Python by Priyaj
• 58,100 points
2,228 views
0 votes
1 answer

Iterating over dictionaries using 'for' loops

key is just a variable name. for key ...READ MORE

answered Oct 8, 2018 in Python by SDeb
• 13,300 points
566 views
0 votes
1 answer

Conflicting dependencies of pypyodbc and blpapi

I figured out that pypyodbc only works ...READ MORE

answered Oct 9, 2018 in Python by Priyaj
• 58,100 points
374 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP