I\'ve been trying on and off for the past 6 months to get OpenCV to work with Python on MacOS. Every time there\'s a new release, I try again and fail. I\'ve tried both 64-bit a
It works all right for me. Here's my setup:
Python 2.7.2 (default, Jan 13 2012, 17:11:09)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv
>>>
brew install opencv
works like a charm
I have tried to install opencv +python27 with Macports and, likewise, I cannot import opencv. If I give up on Python 2.7 and use the Python 2.6 version, it just works. I haven't gone further than this. Good luck!
Coincidentally, I did this yesterday, and it works now. I used the guide found here, in Section 2, "Building via Homebrew".
Except, it says.
sudo brew install python ( the system python is not good enough)
DO NOT ADD THIS LINE. It gave me so much trouble. Python 2.6.1 runs perfectly with OpenCV. By adding that line, homebrew installs Python2.7, and OpenCV will then bind to that version in stead of the default system version. You can then move the cv.so file, but you will still get the version mismatch error.
I don't know why you were downvoted, it's a legitimate problem, perhaps people think you should take your problem to the OpenCV people.