esdalmaijer / PyGaze

an open-source, cross-platform toolbox for minimal-effort programming of eye tracking experiments
www.pygaze.org
GNU General Public License v3.0
671 stars 211 forks source link

Getting error and no calibration fixation dots. #43

Closed cyrus closed 6 years ago

cyrus commented 8 years ago

Dear Edwin,

I hope you are doing well today. I have spent all day trying to get PyGaze to work, but I am stuck on an error.

When it tries to calibrate, the fixation circles are not appearing. I am using the example script:

python simple_tracker_experiment.py Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pygaze/_eyetracker/eyelinkgraphics.py", line 246, in draw_cal_target
    self.play_beep(pylink.CAL_TARG_BEEP)
  File "/usr/local/lib/python2.7/dist-packages/pygaze/_eyetracker/eyelinkgraphics.py", line 264, in play_beep
    if EYELINKCALBEEP:
NameError: global name 'EYELINKCALBEEP' is not defined

This variable is defined in my constants.py file.

also, I get this error too, if I bypass the calibration:

Traceback (most recent call last):
  File "simple_tracker_experiment.py", line 66, in <module>
    checked = tracker.drift_correction()
  File "/usr/local/lib/python2.7/dist-packages/pygaze/_eyetracker/libeyelink.py", line 353, in drift_correction
    return self.manual_drift_correction(pos)
  File "/usr/local/lib/python2.7/dist-packages/pygaze/_eyetracker/libeyelink.py", line 367, in manual_drift_correction
    self.draw_drift_correction_target(pos[0], pos[1])
  File "/usr/local/lib/python2.7/dist-packages/pygaze/_eyetracker/libeyelink.py", line 1053, in draw_drift_correction_target
    self.scr.draw_fixation(fixtype='dot', colour=FGC, pos=(x,y), pw=0, \
NameError: global name 'FGC' is not defined

Do you have any idea what is going on?

I am using: PyGaze version 0.5 (01-10-2014) Ubuntu 14.04 pylink version (1, 0, 0, 37) Eyelink 1000+

Thanks,

Cyrus

cyrus commented 8 years ago

Note: I have also tested this with PyGaze 0.6.0_a3 (from Sebastian's "os3" branch) and I get the same exact error....

Thanks,

cyrus commented 8 years ago

Also, When I switch to "psychopy" from "pygame", I get this:

Traceback (most recent call last):
  File "simple_tracker_experiment.py", line 20, in <module>
    tracker = eyetracker.EyeTracker(disp)
  File "/usr/local/lib/python2.7/dist-packages/pygaze/eyetracker.py", line 68, in __init__
    self.__class__.__init__(self, display, **args)
  File "/usr/local/lib/python2.7/dist-packages/pygaze/_eyetracker/libeyelink.py", line 166, in __init__
    self.eyelink_graphics = EyelinkGraphics(self, _eyelink)
  File "/usr/local/lib/python2.7/dist-packages/pygaze/_eyetracker/eyelinkgraphics.py", line 70, in __init__
    self.mouse = Mouse(timeout=0)
  File "/usr/local/lib/python2.7/dist-packages/pygaze/mouse.py", line 49, in __init__
    self.__class__.__init__(self, **args)
  File "/usr/local/lib/python2.7/dist-packages/pygaze/_mouse/psychopymouse.py", line 59, in __init__
    win=psychopy.visual.openWindows[settings.SCREENNR])
AttributeError: 'module' object has no attribute 'openWindows'
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/usr/lib/pymodules/python2.7/psychopy/visual/textbox/font_manager.py", line 29, in my_close_open_files
    for fileh in open_files.keys():
AttributeError: '_FileRegistry' object has no attribute 'keys'
Error in sys.exitfunc:
Traceback (most recent call last):
  File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/usr/lib/pymodules/python2.7/psychopy/visual/textbox/font_manager.py", line 29, in my_close_open_files
    for fileh in open_files.keys():
AttributeError: '_FileRegistry' object has no attribute 'keys'
0.3252  WARNING     Creating new monitor...
0.3253  WARNING     Creating new monitor...
smathot commented 8 years ago

I have pushed some fixes to my 0.6.0 branch. You can just update through the Ubuntu PPA. Does that work for you?

cyrus commented 8 years ago

I will try it now!

Thanks, Sebastian.

ghost commented 7 years ago

Dear cyrus,

I am new to PyGaze and I have the same problem with you. Could you tell me how do you solve the problem 'NameError: global name 'EYELINKCALBEEP' is not defined'. Also I have no access to pylink package now, would you please provide it for me.

Thank you, Runxue Bao

esdalmaijer commented 6 years ago

Fixed with https://github.com/esdalmaijer/PyGaze/commit/c03473c6d093cc75d9b33b32ac30d9e3105f566d