Installation

Setting up a working Python installation can be tricky. Although open-source software in general, and Python in specific, is truly amazing, sometimes it has it’s drawbacks. One of these drawbacks is that it can be rather consumer unfriendly. This is actually why some people prefer to use proprietary software: you pay for it, but that means you’ll receive ample support too.

That being said, we have done our best to provide you with a complete list of everything you’ll need to run PyGaze as smoothly as possible. If this is your first attempt at using Python, we suggest you read and follow the instructions below. Alternatively, if you’re a Windows user, you could opt for downloading our complete package for Windows, which requires no installation whatsoever.

A couple of disclaimers: We’re not in any way affiliated with or responsible for the packages listed below, credits go out to the respective authors, as should your eternal gratitude. Apart from this, the following instructions are meant to help you, but come without any warranty or guarantees. If your computer blows up, sets fire to your cat, or causes World War 3 while you were following our guidelines, then this is not our responsibility. But we do send our condolences for your cat.

Windows and Linux

A very complete guide to installing PyGaze and its dependencies on Linux has been written by Joseph DeVeaugh-Geiss. You can read his blog post, or download the guide as a PDF.

Installing Python

PyGaze runs on Python, an awesome programming language. You can download it here. Please select the version that is appropriate for your operating system, and download the 32-bit version! This is important, as some of PyGaze’s dependencies do not work on a 64-bit version. If you’re wondering where the Linux download is, you’ve been underappreciating your OS, as one of the cool things about nearly every Linux version is that Python is pre-installed.

Direct downloads
Windows
OS X

Installing NumPy

NumPy is an invaluable tool for every researcher that ever needs to do any kind of calculations. MATLAB users will find its syntax really familiar (see here for more on that), and we would advise any other researcher to invest some time in learning to work with it. NumPy is part of the SciPy project, which contains some other cool packages that are worth checking out too (matplotlib in particular). For PyGaze, downloading NumPy should suffice, but installing SciPy is a smart move (you’ll need it for PsychoPy).

Direct downloads
Linux: run sudo apt-get install python-numpy
Windows
OS X 10.6
OS X 10.3
Other downloads: SciPy and Matplotlib
SciPy download page
Linux: run sudo apt-get install python-scipy
matplotlib download page
Linux: run sudo apt-get install python-matplotlib

Installing PIL

The Python Image Library is a truly excellent library for image processing. Loading, resizing, rotating, flipping, and all kinds of funky stuff with pretty much every image format that you can think of, that’s what PIL does best.

Direct downloads
Linux: run sudo apt-get install python-imaging
Windows
OS X

Installing PyGame

PyGame is another one of those packages you cannot do without. PyGame was developed to create games with, but is very suitable for experiment programming as well. It’s a very versatile library that will run on virtually anything, from potatoes to high-end gaming PCs.

Direct downloads
Linux: run sudo apt-get install python-pygame
Windows
OS X

Installing PsychoPy

PsychoPy is a bit of a necessity for everyone involved in cognitive neuroscience. It’s a toolbox that uses OpenGL for stimulus generation, which makes it really fast and capable of unsurpassed timing accuracy. In terms of functionality, it pretty much is on par with the PsychToolbox for Matlab. PsychoPy depends on pyglet and wxPython, so you’ll need to download those too. Usually, that should do it. Otherwise, see here and download dependencies listed there until your installation works. Windows users should install the Python for Windows extension as well.

If you’re not experienced with Python, sometimes the installation process for external packages can be rather confusing. We have put together a small package that contains installation instructions and short scripts for both Windows and Mac users (Linux users don’t need this, since they can simply use the apt-get commands provided below). The package can be downloaded here (download and unzip to any location). The installation method suggested in this package requires the installation of a package called setuptools. Downloading instructions for that package are included in our PsychoPy downloading instructions.

Direct downloads PsychoPy
Linux: run sudo apt-get install psychopy
Windows
OS X
Direct downloads pyglet
Linux: run sudo apt-get install python-pyglet
pyglet for Windows
pyglet for OS X
Direct downloads wxPython
Linux: should be installed with PsychoPy; if not, please follow these instructions
wxPython for Windows
wxPython for OS X
Direct downloads pyWin32 (ONLY for Windows users!)
pyWin32

Installing pylink

PyLink is a proprietary library, created by SR Research. You can use it to communicate with EyeLink setups. To download it, you’ll need to register at the SR Research support forum. Don’t worry, this is free. You will need to provide some personal information, though. Once your registration is complete, click on one of the links below to directly download the package of your choice. If none of these work for you, please have a look at this thread on the SR forum.

Once you have downloaded the package, unzip it to a location of your choice. Open the unzipped folder and look for a folder called ‘pylink27′. Copy this folder to your the site-packages directory of your Python installation (Windows: C:\Python27\Lib\site-packages; Linux: usr/lib/pymodules), and rename it to ‘pylink’.

Direct downloads
Linux
Windows
OS X

Installing PyViewX

The PyViewX API is for communication with eye trackers manufactured by SensoMotoric Instruments (SMI) and cannot simply be downloaded. You’ll have to request a download, provide some personal details, and wait until you receive an e-mail with a download link.

Direct downloads
No direct downloads available; request a download link on the SMI website

Installing Tobii package

Communication with Tobii eye trackers is done via Tobii’s own Python bindings. Mind you that these are rather hard to use for the average user. Come to think of it, it’s an experience most expert Python users won’t soon forget either. Luckily, Hiroyuki Sogo (Ehime University) has created something far more useable. Although his website is in Japanese and we do not understand a word of it (which we do dearly regret), Python is a language we all speak. Therefore, we have been able to incorporate and modify Hiroyuki’s TobiiController for PsychoPy to work with PyGaze. A nice demonstration of international open-source cooperation!

Once you have downloaded the package, unzip it to a location of your choice. Open the unzipped folder and look for a folder called ‘Python27′ (or ‘python27′). You’ll find a folder called ‘Modules’ (or ‘modules’) in there. Open it and copy it’s contents (ALL of it!) to the site-packages directory of your Python installation (Windows: C:\Python27\Lib\site-packages; Linux: usr/lib/pymodules).

Direct downloads
No direct downloads available; request a download link on the Tobii website (keep in mind that you’re looking for the 32 bit version!)

Comments are closed