Eyelink libraries

You can download eyelink libraries from SR-Research. You will need to register for a free account with them before being able to access the support pages. The manual is here. Follow the download instructions here. The following worked for me:

python3 -m pip install --index-url=https://pypi.sr-support.com sr-research-pylink

Eyelink connection

Setup

The first thing you want to do is set up the network connection to Eyelink from the computer and check that it works. You do this, by connecting the Ethernet cable from the Eyelink computer to your computer (make sure this is the appropriate cable, Eyelink uses a crossed-cable, which swaps read and write for direct connections, and not any old ethernet cable).

Now go into System Settings → Network choose the ethernet device, and make sure the settings match these:

Notably, you want the IP address to be set manually to 100.1.1.2 and the subnet mask to be 255.255.255.0. Note that the Eyelink computer will have address 100.1.1.1, and the setting here is for your computer which will have 100.1.1.2.

In a terminal check that you can ping the Eyelink:

(base) DN0a237dd2:~ justin$ ping 100.1.1.1
PING 100.1.1.1 (100.1.1.1): 56 data bytes
64 bytes from 100.1.1.1: icmp_seq=0 ttl=64 time=2.092 ms

Then you can run python code to make sure you can open and close the connection to the Eyelink:

(gru) DN0a237dd2:~ justin$ python
Python 3.12.11 | packaged by Anaconda, Inc. | (main, Jun  5 2025, 08:03:38) [Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pylink
>>> eyelink = pylink.EyeLink("100.1.1.1")
1495 thread_policy_set failed: 4.
1466 thread_policy_set failed: 4.
1495 thread_policy_set failed: 4.
displayAPI: Connecting
>>>

On the Eyelink computer, You should see the green bar on the right change from “Link Closed” to “TCP/IP Link Open”

You are then ready to go. You can close the connection by doing:

>>> eyelink.close()

Troubleshooting

If you hang when opening the eyelink connection in python, it could be that there is no network path to Eyelink. Check by doing a ping on 100.1.1.1 I found that this works in a standalone terminal, but does not work from VS Code. The solution was to run VS Code as follows from a terminal which can ping 100.1.1.1:

(gru) DN0a237dd2:/Users/justin> /Applications/Visual\ Studio\ Code.app/Contents/MacOS/Electron &