esdalmaijer / webcam-eyetracker

Webcam-based pupil-tracker, complete with GUI to perform calibrations.
http://www.pygaze.org/2015/06/webcam-eye-tracker/
GNU General Public License v3.0
294 stars 105 forks source link

Couldn't get it to run on OS X Yosemite #3

Closed songproducer closed 6 years ago

songproducer commented 8 years ago

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! :(

esdalmaijer commented 8 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?

SuperstrongBE commented 8 years ago

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'

lemonad commented 8 years ago

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.

esdalmaijer commented 8 years ago

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