title: building PyOpenNI on OSX
body: <p>I'm researching an appropriate (or at least straightforward stack) for ultimately getting skeleton information from a kinect, via a python api on an OSX platform. Most of the information I am finding is quite spread out and disconnected.</p>
  
  <p>While it seems perfectly obvious that a windows-based stack would be microsoft's own pykinect on top of their kinect SDK, I can't seem to figure out what works well in an OSX environment.</p>
  
  <p>Here is the info that I have compiled so far:</p>
  
  <ul>
  <li><a href="https://github.com/OpenKinect/libfreenect" rel="nofollow">libfreenect</a> is the obvious source for the low level drivers (this part is working just fine)</li>
  <li><a href="http://openni.org/" rel="nofollow">OpenNI</a> offers the framework + NITE middleware to provide recognition. (not python)</li>
  <li><a href="https://github.com/jmendeth/PyOpenNI" rel="nofollow">PyOpenNI</a> - python bindings for OpenNI with support for skeleton and other advanced features.</li>
  </ul>
  
  <p>I have concluded that this is the most recommended stack to date. What I would like to achieve is simple skeleton data similar to what the windows SDK python wrapper gives you out of the box. Ultimately I will be using this in a PyQt-based app to draw the display, and then into Maya to apply the data.</p>
  
  <p>My question is two parts, and I would accept an answer in either direction if it were the most appropriate...</p>
  
  <p><strong>Build issues for PyOpenNI</strong></p>
  
  <p>So far, I have been unable to successfully build PyOpenNI on either OSX Snow Leopard (10.6.8), or Lion (10.7.4). Both systems have updated xcode. I have noticed that the source files are hardcoded to expect python2.7, so on snow leopard I have had to make sure it was installed and  the default version (also tried a virtualenv).</p>
  
  <p>On Snow Leopard, I was seeing the cmake process find different libs, headers, bin for python, and ultimately the make produced an .so that crashed with 'mismatched interpreter'.</p>
  
  <p>On Lion, I also got mismatched interpreter crashes. But after I installed python2.7 via homebrew, it generated a new error:</p>
  
  <pre><code>ImportError: dlopen(./openni.so, 2): Symbol not found: _environ
    Referenced from: /usr/local/lib/libpython2.7.dylib
    Expected in: dynamic lookup
  </code></pre>
  
  <p>Are there any specific steps to building this on OSX that I am missing, such as environment variables to ensure its pointing at the correct python2.7 libs? Does anyone have a successful build process for this platform?</p>
  
  <p><strong>Alternate question</strong>  </p>
  
  <p>Is this still the most recommended stack for OSX?</p>
  
  <p><strong>Follow up</strong></p>
  
  <p>I've accepted my own answer as a temporary working solution. If someone can provide a better one, I will gladly accept it!</p>