Closed songproducer closed 6 years ago
It seems PyGame isn't installed properly. Considering you're on OS X, could you make sure you've installed PyGame in the Python installation that you are using for webcam-eyetracker? What happens if you try import pygame
?
For me import pygame work under the python shell, and import pygame.camera also work but pygame.camera.init() throw the error : ImportError: cannot import name '_camera'
I have the same problem as @SuperstrongBE, imports work but pygame.camera.init()
throws ImportError: cannot import name _camera
.
Edit: Seems like pygame.camera is not supported on OS X.
I'm moving towards OpenCV, and just leaving the old PyGame implementation there for historical purposes. I suggest trying the OpenCV code: https://github.com/esdalmaijer/webcam-eyetracker/tree/master/PyOpenCV
python camtracker.py Traceback (most recent call last): File "camtracker.py", line 23, in
pygame.camera.init()
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pygame/camera.py", line 40, in init
from pygame import _camera
ImportError: cannot import name '_camera'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "camtracker.py", line 25, in
raise Exception("Error in camtracker: PyGame could not be imported and initialized! :(")
Exception: Error in camtracker: PyGame could not be imported and initialized! :(