psychopy.org | Reference | Downloads | Github

Can't Import pylink in Psychopy Standalone

Hi all,

I’ve been trying to get the visualsearch_eyetracker.psyexp demo working (in dummy mode as I don’t have access to our eyelink tracker at the moment), but I’m failing at the first hurdle of importing pylink.

I get this error when I try import pylink in the coder shell:

>>> import pylink
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "./__init__.py", line 57, in <module>
ImportError: dlopen(/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/pylink/pylink_c.cpython-36m-darwin.so, 2): Library not loaded: @executable_path/../Frameworks/eyelink_core.framework/Versions/A/eyelink_core
  Referenced from: /Applications/PsychoPy.app/Contents/Resources/lib/python3.6/pylink/pylink_c.cpython-36m-darwin.so
  Reason: image not found

I’ve downloaded and installed the EyeLink Developers Kit v1.11.1 (32 and 64 bit) and I’ve checked that eyelink_core.framework is definitely within my Library/Frameworks directory but for some reason the library isn’t getting loaded.

This is a fresh install of PsychoPy Standalone v2021.1.2 running on macOS 10.14.6

Any help with this would be greatly appreciated!

Could you try running one of the python examples included with the EyeLink Developers Kit / pylink and see if that runs? If I recall, the first time you run the pylink libs on macOS it complains about the lib signing and you have to tell macOS to allow it to run anyhow. I wonder if that is what is blocking it for you.

Hi Sol,

I’m afraid I get the same error when running the pylink example scripts in Psychopy standalone, and I don’t remember ever being asked for run permissions by macOS.

The good news is that I’ve been able to get iohub and pylink imported and working inside Spyder. Therefore, I’ve decided to code the experiment from scratch instead of using the builder, however I’m left scratching my head as to why I couldn’t get pylink to work in Psychopy standalone…

I wonder if a different version of pylink is being used in PsychoPy Builder vs. what you installed yourself. Do you mind checking what version of pylink you installed so we can see if it is different from what is included with PsychoPy?

import pylink
print(pylink.__version__) 

Thank you, and sorry for the inconvience.