psychopy.org | Reference | Downloads | Github

Eyetracking (eyelink) code doesn't work with PsychoPy2021.2.3

OS : Mac Capitan, Mac Catalina, Mac High Sierra 10.13.6
PsychoPy version : 2021 2.3
Standard Standalone? (y/n) : y
What are you trying to achieve?: We recently updated our PsychoPy versions in the lab from PsychoPy 2020.2.6 to PsychoPy2021.2.3 and I’m getting persistent errors when trying to run simple eyelink code, including the demo (simple.py) that came with the package. These errors are occurring on two different machines in the lab. I’ll post the code along with the errors.

What did you try to make it work?: I have been reading some older topics in the forum but I have not been able to solve the issue despite trying to configure yaml files differently. Identical code works in PsychoPy 2020.2.6 but fails in 2021.2.3.


from psychopy.iohub import launchHubServer
from psychopy.core import getTime, wait
from psychopy import core, visual

iohub_config = {‘eyetracker.hw.sr_research.eyelink.EyeTracker’:
{‘name’: ‘tracker’,
‘model_name’: ‘EYELINK 1000 DESKTOP’,
‘runtime_settings’: {‘sampling_rate’: 500,
‘track_eyes’: ‘RIGHT’}
}
}
io = launchHubServer(**iohub_config)

tracker = io.devices.tracker

r = tracker.runSetupProcedure()

tracker.setConnectionState(False)


*** i.ohub warni.ng: Display/ Monitor unit type has not been set. Error during device creation …
Traceback (most recent call last):
File “/Applications/PsychoPy3_2021.2.3.app/Contents/Resources/lib/python3.6/psychopy/'iohub/server.py”, line 667, in createNewMon’itoredDev’ice
dev_data = self.addDeviceToMon’itor(dev_cls_name, dev_conf)
File “/Appl’ications/PsychoPy3_2021.2.3.app/Contents/Resources/l’ib/python3.6/psychopy/iohub/server.py”, line 818, in addDev’iceToMon’itor
dev_cls_name)
File “/Appl’icat’ions/PsychoPy3_2021.2.3.app/Contents/Resources/l’ib/python3.6/psychopy/'iohub/dev’ices/_'in’it py”,
l’ine 935, 'in 'import_dev’ice
module= 'import (module_path, froml’ist=["{}".format(dev’ice_class_name)])
F’lie “/Appl’icat’ions/PsychoPy3_2021.2.3.app/Contents/Resources/l’ib/python3.6/psychopy/'iohub/dev’ices/eyetracker/hw/sr_research
/eyel’ink/ in’it .py”, l’ine 5, in
from .eyetracker 'import (EyeTracker, MonocularEyeSampleEvent,
F’lie “/Appl’icat’ions/PsychoPy3_2021.2.3.app/Contents/Resources/l’ib/python3.6/psychopy/iohub/dev’ices/eyetracker/hw/sr_research
/eyel’ink/eyetracker.py”, l’ine 6,'in
'import pyl’ink
File “./ in’it .py”, line 57, 'in lmportError:
dlopen(/Applicat’ions/PsychoPy3_2021.2.3.app/Contents/Resources/l’ib/python3.6/pyl’ink/pylink_c.cpython-36m-darw’in.so,
2) : Symbol not found: _NSApp
Referenced from:
/Appl’ications/PsychoPy3_2021.2.3.app/Contents/Resources/l’ib/python3.6/pyl’ink/pylink_c.cpython-36m-darwin.so Expected in: flat namespace
'in /Applicat’ions/PsychoPy3_2021.2.3.app/Contents/Resources/lib/python3.6/pyl’ink/pylink_c.cpython-36m-darwin.so Error during device creation …
Traceback (most recent call last):
File “/Applications/PsychoPy3_2021.2.3.app/Contents/Resources/l’ib/python3.6/psychopy/'iohub/server.py”, line 667, in createNewMon’itoredDev’ice
dev_data = self.addDev’iceToMon’itor(dev_cls_name, dev_conf)
File “/Applications/PsychoPy3_2021.2.3.app/Contents/Resources/lib/python3.6/psychopy/'iohub/server.py”, line 818, in addDeviceToMonitor
dev_cls_name)
File “/Appl’ications/PsychoPy3_2021.2.3.app/Contents/Resources/lib/python3.6/psychopy/'iohub/dev’ices/init py",
line 935, 'in import_dev’ice
module= import
(module_path, froml’ist=[”{}".format(device_class_name)])
File “/Applications/PsychoPy3_2021.2.3.app/Contents/Resources/lib/python3.6/psychopy/iohub/devices/eyetracker/hw/sr_research
/eyelink/ i.nit .py”, line 5, in
from .eyetracker 'import (EyeTracker, MonocularEyeSampleEvent,
File “/Applications/PsychoPy3_2021.2.3.app/Contents/Resources/lib/python3.6/psychopy/iohub/devices/eyetracker/hw/sr_research
/eyelink/eyetracker.py”, line 6, in
i. mport pyl’ink
File “./ 'in’it py”,line 57, in
ImportError:
dlopen(/Applications/PsychoPy3_2021.2.3.app/Contents/Resources/lib/python3.6/pylink/pylink_c.cpython-36m-darwi.n.so, 2): Symbol not found: _NSApp
Referenced from:
/Appli.cat’ions/PsychoPy3_2021.2.3.app/Contents/Resources/lib/python3.6/pyl’ink/pyli.nk_c.cpython-36m-darwin.so
Expected in: flat namespace
in /Applications/PsychoPy3_2021.2.3.app/Contents/Resources/li.b/python3.6/pylink/pylink_c.cpython-36m-darw’in.so

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/Applications/PsychoPy3_2021.2.3.app/Contents/Resources/lib/python3.6/psychopy/iohub/server.py”, line 601, in
_addDev’ices
self.createNewMonitoredDevice(dev_cls_name, dev_conf)
File “/Applications/PsychoPy3_2021.2.3.app/Contents/Resources/lib/python3.6/psychopy/iohub/server.py”, line 680, in createNewMonitoredDevice
raise ioHubError('Error during device creation ')
psychopy.iohub.errors.'ioHubError:ioHubError:
Args: ('Error during device creation ',)

'ioHub Server Process Completed W’ith Code: 0
2021-10-15 15:02:27.832 python[18957:537028] ApplePers’istencelgnoreState: Exi.st’ing state w’ill not be touched. New state w’ill be written to /var/folders/lp/bw3834vs2737xlmxkswzxjg80000gq/T/org.opensc’iencetools.psychopy.savedState
_addDev’iceV’iew: Error adding class. Traceback (most recent call last):
File “/Appl’ications/PsychoPy3_2021.2.3.app/Contents/Resources/lib/python3.6/psychopy/'iohub/client/ 'init py”, line
1034, 'in addDev’iceView
dev
’import_result = 'import_device(dev_mod_pth, dev_cls_name)
File “/Applications/PsychoPy3_2021.2.3.app/Contents/Resources/lib/python3.6/psychopy/iohub/devices/ init py”,
line 935, in import_device
module= import (module_path, fromlist=["{}".format(dev’ice_class_name)])
File “/Appl’ications/PsychoPy3_2021.2.3.app/Contents/Resources/lib/python3.6/psychopy/iohub/dev’ices/eyetracker/hw/sr_research
/eyelink/ 'ini.t .py”, line 5, 'in

from .eyetracker 'import (EyeTracker, MonocularEyeSampleEvent,
F’lie “/Applications/PsychoPy3_2021.2.3.app/Contents/Resources/lib/python3.6/psychopy/iohub/devices/eyetracker/hw/sr_research
/eyelink/eyetracker.py”, line 6, in
'import pylink
File “./ 'init_.py”, line 57, in ImportError:
dlopen(/Applications/PsychoPy3_2021.2.3.app/Contents/Resources/lib/python3.6/pylink/pyl’ink_c.cpython-36m-darwin.so,
2): Symbol not found: _objc_alloc_ini.t
Referenced from:
/Applications/PsychoPy3_2021.2.3.app/Contents/Resources/lib/python3.6/pylink/pylink_c.cpython-36m-darwin.so
Expected 'in: flat namespace
in /Appli.cati.ons/PsychoPy3_2021.2.3.app/Contents/Resources/lib/python3.6/pyl’ink/pyl’ink_c.cpython-36m-darwi.n.so Traceback (most recent call last):
File “/Users/psphuser/Desktop/olmanlab/PENS2.l/PENS2.l/Eyetrack’ing/EYELINK_DEMO.py”, line 16, in tracker= i.o.devices.tracker
Attr’ibuteError: '‘ioHubDevices’ object has no attribute ‘tracker’

Experiment ended.#####

It looks like pylink is failing to import, suggesting a packaging issue.
This is happenning when you installed the latest PsychoPy macOS standalone (v2021.2.3)?

1 Like

Yes, on two different systems in the lab. I can try to investigate the pylink package problem. Thanks for the insight.

OK, I’ll try it out tomorrow when I have access to my macbook. If 2020.2.6 works, maybe stick with that until we figure out what is going on in the latest macOS build. Thank you

1 Like

Sorry, I just rechecked the OS versions and they are High Sierra and El Capitan.

I am able to reproduce this issue using 2021.2.3 on macOS (including Big Sur). I’m not sure why pylink import is failing in this release though. Even copying the pylink folder from a older working release into the Contents of 2021.2.3 does not fix the issue.

We will have to try and sort this out for the next release. Thank you for reporting the issue.

1 Like