1

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.

Billal Begueradj
  • 20,717
  • 43
  • 112
  • 130
  • There are some possible answers at http://stackoverflow.com/questions/21140953/opencv-installed-but-not-linked-error-message-on-os-x-mavericks – David Whitlock Jan 11 '17 at 00:44

1 Answers1

1

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

Ugnius Malūkas
  • 2,649
  • 7
  • 29
  • 42
  • @felipsmartins A code-only answer might not be a good one, but it's still an answer. I would recommend you this post about the LQPRQ: [You're doing it wrong: A plea for sanity in the Low Quality Posts queue](http://meta.stackoverflow.com/questions/287563/youre-doing-it-wrong-a-plea-for-sanity-in-the-low-quality-posts-queue) – FelixSFD Jan 11 '17 at 14:15