| 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 ( 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()


*** i.ohub Display/ Monitor unit type has not been set. Error during device creation …
Traceback (most recent call last):
File “/Applications/'iohub/”, line 667, in createNewMon’itoredDev’ice
dev_data = self.addDeviceToMon’itor(dev_cls_name, dev_conf)
File “/Appl’ications/’ib/python3.6/psychopy/iohub/”, line 818, in addDev’iceToMon’itor
File “/Appl’icat’ions/’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/’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/’ib/python3.6/psychopy/iohub/dev’ices/eyetracker/hw/sr_research
/eyel’ink/”, l’ine 6,'in
'import pyl’ink
File “./ in’it .py”, line 57, 'in lmportError:
2) : Symbol not found: _NSApp
Referenced from:
/Appl’ications/’ib/python3.6/pyl’ink/ Expected in: flat namespace
'in /Applicat’ions/’ink/ Error during device creation …
Traceback (most recent call last):
File “/Applications/’ib/python3.6/psychopy/'iohub/”, line 667, in createNewMon’itoredDev’ice
dev_data = self.addDev’iceToMon’itor(dev_cls_name, dev_conf)
File “/Applications/'iohub/”, line 818, in addDeviceToMonitor
File “/Appl’ications/'iohub/dev’ices/init py",
line 935, 'in import_dev’ice
module= import
(module_path, froml’ist=[”{}".format(device_class_name)])
File “/Applications/
/eyelink/ i.nit .py”, line 5, in
from .eyetracker 'import (EyeTracker, MonocularEyeSampleEvent,
File “/Applications/
/eyelink/”, line 6, in
i. mport pyl’ink
File “./ 'in’it py”,line 57, in
dlopen(/Applications/, 2): Symbol not found: _NSApp
Referenced from:
Expected in: flat namespace
in /Applications/’

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/Applications/”, line 601, in
self.createNewMonitoredDevice(dev_cls_name, dev_conf)
File “/Applications/”, line 680, in createNewMonitoredDevice
raise ioHubError('Error during device creation ')
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:’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/'iohub/client/ 'init py”, line
1034, 'in addDev’iceView
’import_result = 'import_device(dev_mod_pth, dev_cls_name)
File “/Applications/ init py”,
line 935, in import_device
module= import (module_path, fromlist=["{}".format(dev’ice_class_name)])
File “/Appl’ications/’ices/eyetracker/hw/sr_research
/eyelink/ 'ini.t .py”, line 5, 'in

from .eyetracker 'import (EyeTracker, MonocularEyeSampleEvent,
F’lie “/Applications/
/eyelink/”, line 6, in
'import pylink
File “./ '”, line 57, in ImportError:
2): Symbol not found: _objc_alloc_ini.t
Referenced from:
Expected 'in: flat namespace
in /Appli.cati.ons/’ink/pyl’ Traceback (most recent call last):
File “/Users/psphuser/Desktop/olmanlab/PENS2.l/PENS2.l/Eyetrack’ing/”, 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