Ask Your Question

Revision history [back]

Hi,

I had installed OpenCV with python on my mac using homebrew without any problems about 6 months ago:

  1. $brew install opencv

  2. Homebrew printed a message after installation that I need to specify the python path correctly and I added this line in my .bash_profile:

    export PYTHONPATH="/usr/local/lib/python2.7/site-packages:$PYTHONPATH"

It worked for me perfectly (for example, I have autocompletion of the OpenCV Python interface in MacVim).

Hi,

I had installed OpenCV with python on my mac using homebrew without any problems about 6 months ago:

  1. $brew install opencv

  2. Homebrew printed a message after installation that I need to specify the python path correctly and I added this line in my .bash_profile:

    export PYTHONPATH="/usr/local/lib/python2.7/site-packages:$PYTHONPATH"

It worked for me perfectly (for example, I have autocompletion of the OpenCV Python interface in MacVim).

UPD: Also if you run $brew info opencv then homebrew will print this information about Python bindings:

==> Caveats

The OpenCV Python module will not work until you edit your PYTHONPATH like so:
export PYTHONPATH="/usr/local/lib/python2.7/site-packages:$PYTHONPATH"

To make this permanent, put it in your shell's profile (e.g. ~/.profile).