MacOS 10.6.7: OpenCV + Python27

Brickle Macho bricklemacho at
Tue Apr 5 18:06:35 PDT 2011

I am trying to install OpenCV, QT and Python on MacOS 10.6.7 via Mac
Ports.  Everything seems to install except for OpenCV.   I am just
learning Python, OpenCV and QT so hopefully I may have overlooked
something simple, like setting an environment variable.  The MacPorts
OpenCV installation fails.  I have followed the following steps:

After doing a selfupdate and upgrade outdated I installed: python27,
py27-qt4, python27-numpy, and python_select install sucessfully.   I
then ran python_select python27. I am able to run the examples from Mark
Summerfiled's book:  Rapid GUI Programming with Python and QT so suggest
that PYQT4 is working.  Then I attempted to install opencv with python
bindings as follows:

sudo port install opencv +python27

Any help with the following error would be appreciated:

--->  Building opencv
Error: Target returned: shell command failed (see log
for details)
Log for opencv is at:
Error: Status 1 encountered during processing.
To report a bug, see <>

Looking at the log file I see:

tail -20

:info:build Generating file index...
:info:build Generating example index...
:info:build Generating file member index...
:info:build finalizing index lists...
:info:build finished...
:info:build /opt/local/bin/cmake -E cmake_progress_report

:info:build [ 74%] Built target DOXY_HTML
:info:build make[2]: ***
[modules/features2d/CMakeFiles/opencv_features2d.dir/src/matchers.o] Error 1
:info:build make[1]: ***
[modules/features2d/CMakeFiles/opencv_features2d.dir/all] Error 2
:info:build make: *** [all] Error 2
:info:build shell command " cd
&& /usr/bin/make -j4 all " returned error 2
:error:build Target returned: shell command failed
(see log for details)
:debug:build Backtrace: shell command failed (see log for details)
    while executing
"command_exec build"
    (procedure "portbuild::build_main" line 8)
    invoked from within
"$procedure $targetname"
:info:build Warning: the following items did not execute (for opencv):
org.macports.activate org.macports.destroot
:notice:build Log for opencv is at:

More information about the macports-users mailing list