Getting PyKinect to work correctly

Jun 5, 2012 at 8:55 PM

Hello, I've been searching around these forums for a while and I couldn't find a discussion that actually answered this question. I have all of the software installed (sdk v1.5 etc) but i'm still having problems with this one line of code.

I can import pykinect, but trying:

from pykinect import nui

I get the following error

Traceback (most recent call last):
  File "<pyshell#7>", line 1, in <module>
    from pykinect import nui
  File "C:\Python27\lib\site-packages\pykinect\nui\__init__.py", line 15, in <module>
    _nuidll_path = os.path.join(os.environ['MSRKINECTSDK'], 'MSRKinectNUI.dll')
  File "C:\Python27\lib\os.py", line 423, in __getitem__
    return self.data[key.upper()]
KeyError: 'MSRKINECTSDK'

Does anyone know why?

Coordinator
Jun 5, 2012 at 11:45 PM

I think you have a slightly older version of the pykinect library.  The current version discovers the DLL via:

_nuidll_path= os.path.join(os.environ['WINDIR'], 'System32', 'Kinect10.dll')

 

If you have the most recent version installed you should be able to go into VS and use Tools->Python Tools->PyKinect... menu to re-install into your site-packages.