psychopy.org | Reference | Downloads | Github

Load pylink in anaconda based psychopy

OS: MacOSX 10.11.6
PsychoPy version: 3.1.2
Standard Standalone?: No, anaconda

I want to be able to import the pylink module, to incorporate eyetracking in the experiments I’m running.

What did you try to make it work?:

1- Installed Eyelink Dev kit
2- Installed Anaconda3
3- Created conda environment for psychopy (conda create -n psypy3 python=3.7.1)
4- Activated conda environment (conda activate psypy3)
5- Installed psychopy3 and all it’s dependencies as described here using conda install and pip commands: https://www.psychopy.org/download.html#conda
6- I can launch the psychopy3 GUI successfully (pythonw psychopyApp.py)
7- tried to install pylink using conda install -c auto pylink --> did not work, I got an error in the terminal: “the following packages are not available form current channels: …” --> it might also be not the “pylink” I’m looking for, see point 8.
8- tried to install pylink using pip install pylink --> this installs a module also called “pylink” but inherits different functions: https://github.com/LionelDarras/PyLink
9- tried to import pylink using:
import sys
sys.path.append(“/Applications/Eyelink/pylink/pylink3.2")
import pylink
Step 9 also, didn’t work. It closed my PsychoPy and gave an error in the terminal: “Pylink: could not load module tracker!”
10- I tried to copy pylink folder into to my virtual environment packages folder (˜/anaconda3/envs/psypy3/lib/python3.7/site-packages/).
11- Tried to run gcwindow_main.py after doing point 10 but got this error: "Import: bad magic number in ‘pylink’: v’l\x0c\r\n’ "

On the SR support forum, all the getting started info is on the standalone use of PsychoPy. Is there a way to make it work for PsychoPy within anaconda?

Thank you!

does the Eyelink Dev kit that you downloaded in your step 1 contain a setup.py file?

If yes, you could navigate to that directory and call python setup.py develop (using your command line and your conda environment activated)

conda install or pip install will not connect to your Eyelink Dev kit from step 1 in any way, because neither of the commands is aware of where you downloaded what.

OK, so we also reached out to the SR people on their forum. And the crucial thing is that there is nog pylink for python 3.7, but there is for 3.6. For the solution you can check SR’s response to our post on the other forum here:

https://www.sr-support.com/forum/eyelink/programming/56122-adding-pylink-to-my-path