Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

except COMError, err: SyntaxError: invalid syntax #102

Open
Elisa-code184 opened this issue Jun 22, 2022 · 4 comments
Open

except COMError, err: SyntaxError: invalid syntax #102

Elisa-code184 opened this issue Jun 22, 2022 · 4 comments

Comments

@Elisa-code184
Copy link

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
Copy link

zachvin commented Jun 23, 2022

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.

@Yudh0B
Copy link

Yudh0B commented Sep 29, 2022

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
Copy link
Author

@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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants