Victor Nwadike
Victor Nwadike

Reputation: 93

Opencv not working for python?

When ever I say import cv2 and run in IDLE it gives me an error saying:

Traceback (most recent call last): File "/Users/Victor/Documents/Python Related/Python Code for Class/blah.py", line 2, in import cv2 ImportError: No module named 'cv2'

But when ever I run "brew install opencv" on my Terminal it says:

Warning: homebrew/science/opencv-2.4.13.2 already installed, it's just not linked.

Which I am taking it as Opencv is already installed. I have no idea why it wont work when I run it in python. I have followed this link and I also used this link.

but that did not seem to help much. I have spent all day on trying to make this work ...

Wanted to see if anyone who has experience with OpenCV can give me a bit of guidance. It is definitely not as simple as installing pygame or other models.

Upvotes: 1

Views: 1540

Answers (1)

Ugnius Malūkas
Ugnius Malūkas

Reputation: 2827

Try export PYTHONPATH=/usr/local/lib/python{version}/site-packages:$PYTHONPATH

Upvotes: 1

Related Questions