PyKinect won't load

Dec 9, 2014 at 9:27 PM
Hi everyone -- last night I installed Python Tools, PyKinect and the PyKinect Demos. Python Tools seem to work fine but in the Tools/PythonTools menu there is not Samples option. I guess this isn't surprising since I now get the following error when I launch VS:

The 'PyKinectPackage' package did not load correctly.

The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by examining the file

One problem with this is that I don't have such a file. In fact, I don't have an AppData directory. Another problem is that I'm using Visual Studio 2013 (I assume that the 12.0 in the path above is a reference to 2012). I thought that it might be a permissions problem but as far as I can tell the permission on PyKinect are fine. Any suggestions for what I can try next? PyKinect is the reason that I installed the Python Tools. Thank you.
Dec 9, 2014 at 9:51 PM
Sorry, looks like we'll need to update the PyKinect documentation:

(I'll file a bug)

The docs refer to the PyKinect Visual Studio package, which no longer exists in PTVS 2.1. The version you downloaded was probably for PTVS 2.0, which won't work with PTVS 2.1.

Under the PTVS 2.1 downloads, you'll find a PTVS Samples vsix download. This adds a PyKinect template project under Python\Samples in the New project dialog.

Once you've got the project created, it will prompt you to install pykinect from pip, either in global env or virtual env. It will also explain how to install pygame.
Dec 10, 2014 at 2:08 AM
Edited Dec 10, 2014 at 2:13 AM
Thank you for the very fast reply. I really appreciate it. I think I had the correct version of PyKinect already but I didn't have the Samples. After I downloaded the Samples and created a Pygame project using PyKinect, it prompted as you said but then in the Console pane of VS indicated that the requirement was already met:
Installing 'pykinect'
Requirement already satisfied (use --upgrade to upgrade): pykinect in c:\python27\lib\site-packages
Cleaning up...
'pykinect' was installed successfully.

However, when I relaunch VS, I get the same error referenced in my first post. And in the project, if I hover over pygame VS tells me that it's a built-in module but if I hover over pykinect it tells me that it's an unknown type (the relevant code section is below)
import pygame
import pygame.color
from pykinect import nui

So I deleted PyKinect and went through the install procedure (right-click on the python environment, etc as you outlined) again. It downloaded and said that it installed successfully. In the environment of the project, I see this:

But when I launch VS, I still get the "not loaded correctly" error and it still shows "pykinect" is an "unknown type". I just double checked my PTVS version and it shows 2.1. I'm not sure what to check next.

Update: if I hover over "nui" in the code segment above, it recognizes it as: nui: built-in module pykinect.nui
so perhaps it is recognizing the package. But I'm still confused that the error still appears on launch (and when opening a solution).
Dec 10, 2014 at 2:39 AM
You'll probably need to open Tools-Extensions and Updates to find the other PyKinect VS extension that is giving the error. This will have been installed from our CodePlex site, not from pip.

The reason we don't recognize pykinect in the tooltip is because the name doesn't exist after doing a from/import - typing "pykinect" would be an error, but nui does exist because that's what you've imported. We have a suggestion somewhere to display something less confusing in this case. Since nui appears, out sounds like the package is installed correctly.
Dec 10, 2014 at 2:55 AM
That did the trick. I found the PyKinect Samples v. 2.0 in Extensions and Updates. It told me to use the Conrol Panel to remove it. I did and the error appears to be gone.

Thank you both very much for your outstanding help!