opencv -python

Maximilian Nickel mnick at macports.org
Fri Oct 2 06:26:49 PDT 2009


Hi,

On Fri, Oct 2, 2009 at 2:43 PM, patel deven <deven.patel2 at gmail.com> wrote:
> i have just installed Opencv 2.0. but the python bindings are not working.
> this is what it looks like when i try to import modules

Given that macports only provdies opencv 1.0 i guess you have
installed opencv 2.0
manually?

> i checked the  cd /usr/local/lib64/python2.6/
> site-packages/ directory and
> the "opencv" folder is existing there.  Then why am i unable to import the
> modules??

The reason you can't import it into python is that you have installed it in the
wrong path. MacPorts never installs into /usr/local, furthermore
Python 2.6 is built as
a framework and therefore won't pick up modules from
${prefix}/lib/python2.6/site-packages,
even if /usr/local would be a valid prefix.

You have to tell the install script of opencv to install the python bindings in
${prefix}/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages


More information about the macports-dev mailing list