| 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:
6- I can launch the psychopy3 GUI successfully (pythonw
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:
9- tried to import pylink using:
import sys
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 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 file?

If yes, you could navigate to that directory and call python 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: