Skip to content

Installing PyOpenNI

jmendeth edited this page Feb 5, 2012 · 2 revisions

Building and installing the bindings

1. Download & install OpenNI

Go to the OpenNI repository for download and instructions.

2. Download PyOpenNI

Click the green button to download the source as a ZIP file:

Download source

Then unpack the ZIP. A directory named like jmendeth-PyOpenNI-6e49a32 will be created. Rename it to PyOpenNI.

3. Download & install CMake

PyOpenNI uses CMake to build itself. If you already have it, go to the next step. Else, follow the corresponding steps for your platform:

APT-based systems (Ubuntu, Debian, ...)

It's easy! On a terminal, type in this command:

sudo apt-get install cmake

It will prompt you for your password. Just enter it, press ENTER and follow the steps.

Other Linux, Mac or Unix System

Retrieve the latest stable version of CMake from here.
Once downloaded, unpack and compile it:

mkdir cmake-build
cd cmake-build
../bootstrap
make
make install

By default, this will install CMake in /usr/local, so make sure to have /usr/local/bin in your execute path. To change the installation prefix (e.g. to /usr in Debian), add the --prefix=PATH option to the bootstrap command.

Windows

Retrieve the latest stable version of CMake from here.
Once downloaded, run the cmake installer.

By default, this will install CMake in C:\Program Files\CMake <version>, so make sure to have <installpath>\bin in your execute path.

4. Build the source

Important: PyOpenNI must be built from an external directory! See the next steps.

  1. Create an empty directory where the binaries will be built.

  2. Open a terminal and cd to that directory.

  3. Execute cmake passing the location of the PyOpenNI sources. In my case:

    cmake /home/jmendeth/Downloads/PyOpenNI
    
  4. CMake will then generate the makefiles for your platform (VS 2008/2010, XCode, Makefile, NMake mf, ...).

  5. Build using the generated makefiles. A subdirectory named lib will be created and the finished libraries will be put there. Just copy them to your python modules folder.