A: 

The Python function all() was introduced with version 2.5. You are probably compiling with a version where all() does not exist in the Python language yet.

According to the Python Built-in Functions List, all() is equivalent to:

def all(iterable):
    for element in iterable:
        if not element:
            return False
    return True

You may also need to define any(). It is the equivalent of:

def any(iterable):
    for element in iterable:
        if element:
            return True
    return False

More than likely though, if the setup script requires Python 2.5, so will the rest of the Python wrapper.

greg
A: 

I had this problem.. It's the Python Interface... By Default, Python 2.4 is installed on CentOS, and ot's not easy to upgrade to >2.6.

When OpenCV builds, it is confused by the Python version...

So I've disable the Python interface on "cmake" and it was OK.

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_NEW_PYTHON_SUPPORT=NO ..

But, of course you can not use OpenCV with Python anymore.

Alexadvance