Q:

OpenCv Python osx and homebrew

I'm getting the following error when trying to import cv2 after running python in the terminal-
Python 2.7.3
[GCC 4.2.1 (Based on Apple Inc.) (] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
[1]    3129 segmentation fault  python

As recommended I've also changed my zsh bash profile to include. 
export PYTHONPATH="/usr/local/lib/python2.7/site-packages:$PYTHONPATH"

I installed opencv using brew and python using brew as well. Mac osx 10.7.2. Is the wrong version of python being used/how would I correct this? I don't have numpy installed but I'm under the impression I still shouldnt get that error. 

A:

Macs ships with a version of python. When you install another version of python you need to make sure that it correctly linked in your PATH. This specifies which version of python to use. PYTHONPATH specifies where Python looks for packages.
See here and here.
I recently installed python2.7 and opencv 2.4.5 using mac ports with no problems.

