PyKinect - write Kinect games using Python!
PyKinect enables writing awesome games and interfaces using Python:
Set breakpoints & Explore Kinect sensor data in the debugger directly:
PyKinect itself doesn't depend on Pygame - you can write games without it. However, our samples do. We use it because Pygame is awesome & popular.
PyKinect is a Python package available from
You can install it in your CPython 2.7 32-bit environment using:
pip install pykinect
If you use PTVS with the Visual Studio sample project template, it will prompt to install PyKinect for you at project creation.
The Visual Studio sample project template for PyKinect is available as part of the PTVS Samples 2.1.vsix. Download it from the
PTVS downloads page.
Don't forget to also install Pygame and the Kinect SDK.
To create a sample project, select File, New, Project, then under Python, Samples, choose
PyGame using PyKinect.
You'll have the option of installing PyKinect in a new virtual environment, your global Python 2.7 environment or skip installation.
When the project finishes loading, it will display instructions for installing Pygame. You can skip that if you are using your global Python 2.7 with Pygame already installed.
The sample code basically sets up the event loop & does basic skeleton tracking.
For a slightly more involved sample, please see
This sample renders the skeletons with the video or depth cameras. When you run this sample, it opens a console window & prints the available keyboard commands.
A couple of things to watch out for:
- Currently only 32-bit flavor of CPython is supported (ie, don't install it with a 64-bit Python interpreter even if PTVS allows it)
- If you are not getting skeleton tracking: make sure your body is within the sensor's range & your legs are visible to the camera.
- Sometimes the Pygame event queue can be overfilled - if this happens an exception is raised and can be handled appropriately.
If you develop a game or a sample that you're willing to share, please let us know! We'd love to see what you've come up with & we can feature it here.
This page was generated using a tool. Changes will be lost when the html is regenerated. Source file: PyKinect.md