Kinect / PyKinect2

Wrapper to expose Kinect for Windows v2 API in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AssertionError: 80

DavidYaonanZhu opened this issue · comments

File "C:\Users\David\Anaconda2\lib\site-packages\pykinect2\PyKinectV2.py", line 2216, in
assert sizeof(tagSTATSTG) == 72, sizeof(tagSTATSTG)

You've probably installed via pip and are using x64 Anaconda or similar.

Go to the pykinect2 installation in the site-packages folder (Lib\site-packages\pykinect2) and replace the .py files with the ones from the github repository.

That worked for me, at least.


It would be fantastic if the creator could update the pip package. @vladkol


Duplicate of #17

nitzel, thanks the solution works for me.

thanks it worked for me too

Thanks

Thanks

@nitzel You f**king genius!!! THX~

Thanks!

Thanks Dude!!

Thanks

Works fine to me. Thanks!

Any thoughts on when to fix the pypi package version for ease of use in the future?

@lemoncalamitous Great. I'm pretty sure this repository is completely abandoned by it's owner @vladkol - I've asked for an updated pypi package nearly three years ago but to no avail - so don't expect it.
I no longer have a Kinect around, otherwise I might've forked it and started maintaining it.

To work around this limitation, you can zip up the fixed python package and install it via pip install ./pykinect2.zip if you need it for an automated deployment.

I am using python 2. I have done as per your resolution but still getting below error:
Traceback (most recent call last):
File "ex-playback.py", line 44, in
import PyKinectTk
File "C:\Python27\Lib\site-packages\PyKinectTk_init_.py", line 61, in
File "C:\Python27\lib\site-packages\PyKinectTk\Capture_init_.py", line 1, in
from DataCapture import *
File "C:\Python27\lib\site-packages\PyKinectTk\Capture\DataCapture.py", line 11, in
from ..utils.PyKinect2 import *
File "C:\Python27\lib\site-packages\PyKinectTk\utils\PyKinect2_init_.py", line 1, in
from PyKinectV2 import *
File "C:\Python27\lib\site-packages\PyKinectTk\utils\PyKinect2\PyKinectV2.py", line 2214, in
assert sizeof(tagSTATSTG) == 72, sizeof(tagSTATSTG)
AssertionError: 80

Please help to resolve this

maybe it's a python 2 problem, have you tried python 3?

I checked it with Python 2.7.16 and works, make sure that you have python 2.7 and higher. If it doesn't work uninstall and start from the beginning and make sure that you change the files in the libs/sites-packages/pykinect2.

Yes. I am using 2.7.17 version of python. Tried with python 3 but I think code is using python2. Is there any other suggestion.

Still getting below issue:
(py2) C:\Users\741467\Downloads\PyKinectTk-master\Examples>python ex-playback.py -GUI
Traceback (most recent call last):
File "ex-playback.py", line 44, in
import PyKinectTk
File "C:\Users\741467\AppData\Local\Continuum\anaconda3\envs\py2\lib\site-packages\PyKinectTk_init_.py", line 61, in
import Capture
File "C:\Users\741467\AppData\Local\Continuum\anaconda3\envs\py2\lib\site-packages\PyKinectTk\Capture_init_.py", line 1, in
from DataCapture import *
File "C:\Users\741467\AppData\Local\Continuum\anaconda3\envs\py2\lib\site-packages\PyKinectTk\Capture\DataCapture.py", line 11, in
from ..utils.PyKinect2 import *
File "C:\Users\741467\AppData\Local\Continuum\anaconda3\envs\py2\lib\site-packages\PyKinectTk\utils\PyKinect2_init_.py", line 1, in
from PyKinectV2 import *
File "C:\Users\741467\AppData\Local\Continuum\anaconda3\envs\py2\lib\site-packages\PyKinectTk\utils\PyKinect2\PyKinectV2.py", line 2214, in
assert sizeof(tagSTATSTG) == 72, sizeof(tagSTATSTG)
AssertionError: 80

(py2) C:\Users\741467\Downloads\PyKinectTk-master\Examples>python -version
Unknown option: -e
usage: python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Try `python -h' for more information.

(py2) C:\Users\741467\Downloads\PyKinectTk-master\Examples>python --version
Python 2.7.17

I don't know any other solution. Maybe start for the start and create a new environment with Python 2.7.17 and replace again the PyKinectV2.py and PyKinectRuntime.py files. Easiest way to do this is to use anaconda to isolate and start with a fresh version of python.

Have you tried with extracting features from xef files?
I am able to open GUI now but facing below issue:

Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\741467.conda\envs\py2\lib\lib-tk\Tkinter.py", line 1547, in call
return self.func(*args)
File "C:\Users\741467.conda\envs\py2\lib\site-packages\PyKinectTk\Playback\Select.py", line 148, in to_video
pid = self.performance_id()
File "C:\Users\741467.conda\envs\py2\lib\site-packages\PyKinectTk\Playback\Select.py", line 99, in performance_id
return self._performances[self.selected()]
File "C:\Users\741467.conda\envs\py2\lib\site-packages\PyKinectTk\Playback\Select.py", line 87, in selected
return int(self._listbox.curselection()[0])

commented

Hi, After replaced files i have errors:
Traceback (most recent call last):
File "d:/Pisak/objetosc-PY/Przykłady/openKinect.py", line 3, in
from pykinect2 import PyKinectV2
File "C:\Users\it\AppData\Local\Programs\Python\Python36\lib\site-packages\pykinect2\PyKinectV2.py", line 2868, in
from comtypes import _check_version; check_version('')
File "C:\Users\it\AppData\Local\Programs\Python\Python36\lib\site-packages\comtypes_init
.py", line 121, in _check_version
raise ImportError("Wrong version")
ImportError: Wrong version

Python version: Python 3.6.4
Pip version: pip 21.3.1
Environment: Windows 11 64bit

Any solution?

commented

I solved problem
Installed comtypes==1.1.4

ty I solved problem Installed comtypes==1.1.4