I'm trying to get opencv for python on my mac running mavericks. After googling/stack overflow seraching I tried:
brew install homebrew/science/opencv
Based on the terminal output it looks like that worked.
To verify I wrote a python script that simply contains:
import cv2
print("Hello")
I get no module named cv2. When I try looking at the installed modules by typing help('modules') I don't see cv or cv2. This leaves me with two conclusions: either I didn't properly install opencv or import cv2 isn't actually importing cv2 and python is looking in the wrong location for cv2. Any suggestions would be appreciated.
According to this guide, if you add the following to your .bash_profile it should fix your issue:
export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With