Kinect / PyKinect2

Wrapper to expose Kinect for Windows v2 API in Python
MIT License
503 stars 236 forks source link

except COMError, err: SyntaxError: invalid syntax #102

Open Elisa-code184 opened 2 years ago

Elisa-code184 commented 2 years ago

Hello everyone, I've installed pykinect and comtypes == 1.1.4. I've found the following issue running the PyKinectInfraRed.py example:

except COMError, err: SyntaxError: invalid syntax

I was wondering if anyone can help me. Thank you.

zachvin commented 2 years ago

Did you check #37? I got everything to work with 64-bit Anaconda v4.12.0 in a conda virtual environment with Python 3.6.13. I just did all the instructions on the main github page, with these fixes:

I believe this is everything you need to do to get this code running on a modern Anaconda install.

Yudh0B commented 2 years ago

Did you check #37? I got everything to work with 64-bit Anaconda v4.12.0 in a conda virtual environment with Python 3.6.13. I just did all the instructions on the main github page, with these fixes:

  • pip install comtypes==1.1.4
  • after pip installing pykinect2, replace the .py files in the pykinect2 folder in Anaconda with the matching .py files from the github

I believe this is everything you need to do to get this code running on a modern Anaconda install.

Traceback (most recent call last): File "c:\TA\PyKinect2-master\examples\PyKinectBodyGame.py", line 1, in from pykinect2 import PyKinectV2 File "C:\Users\grego.conda\envs\TA\lib\site-packages\pykinect2\PyKinectV2.py", line 5, in import comtypes File "C:\Users\grego.conda\envs\TA\lib\site-packages\comtypes__init__.py", line 381 except COMError, err:

i've done all the required installation, still ended up with that same error, even tried reinstalling everything related to PyKinect2

Elisa-code184 commented 2 years ago

@Yudh0B I solved installing a less recent version of the Anaconda Environment and Python. If I am not wrong, I solved it with Python 3.7 and Anaconda 1.7.2

But anyway, try to downgrade the version until it works, I assume there is a problem in some library versions. The other option is open and run the single code and solve the issues. I found some syntax errors in some modules because written in Python 2. I gave up at a certain point, and I picked the above solution.

Hope it could help.

sylent1951 commented 5 months ago

i think u need python3.6,i use 3.6.13 and after do all things i fix it