Originally, PsyToolkit only worked on Linux. That is no longer the case, you can now run PsyToolkit in your browser. If you do that, which you might do for a student project or an online learning project, than you do not need to read this!

If you wish to install PsyToolkit on Linux, for example because you want super-precise response timing, or because you want to use a Cedrus external keyboard, then you should read this.

Install Linux and PsyToolkit for Linux

Before you can PsyToolkit on Linux, you need to install Linux on your computer. If you have never done that before, you need to learn about Linux, and here is some background:

Linux can be installed on desktop computers and laptops. Linux is not a program that runs under Microsoft Windows or Mac, but instead it is an Operating System (OS) itself. You can install multiple OSs on a computer (using a multiple boot system), or you can install just Linux on a computer. Either way works. Here is a guide for beginners.

You can, in principle, use any Linux distribution. If you are new to Linux, you might to choose one that is easy to install, such as Mint Linux.

Installing PsyToolkit on Linux.

Step 1. Get the PsyToolkit package

You can download the newest versions in different versions via the download link.

Make sure you download the package for your system. There are prepackaged systems for Debian based systems (such as Mint, Debian, and Ubuntu) and for Arch Linux (see links below).

If you do not have a Debian based or Arch based system, you need to install the source package. If this is the case, please check this link.

If you have a Debian based system (Debian, Mint, Ubuntu, etc), you can simple download and install this file, and then you do not need to worry about any other software packages that PsyToolkit relies on: Download PsyToolkit 2.0.9 for Debian-based systems
If you have an Arch based system, you can download and install the PsyToolkit via AUR: https://aur.archlinux.org/packages/psytoolkit/

Step 2.

Configure the /etc/psytoolkit configuration file. This is optional, but you might want to take out the line "safety_lock". Check the file (it is called /etc/psytoolkit/psytoolkit.<version>.conf

Step 3. You are now ready to roll!

Now you can run the software. Open a terminal window and type psycc -v and man psycc and see what happens.

What is psycc?

In case you are interested, psycc is a cross compiler. It translates the PsyToolkit .psy file into C code, compiles and then runs as a native Linux programme. Alternatively, you can compile your PsyToolkit .psy file in Javascript and HTML5 code, open, and run in a browser on any computer.

Install PsyToolkit from source

You might not have a Debian or Arch-based system. If that is the case, you will need to "install from source". Installing from source is not difficult, but you need to make sure you have installed a whole bunch of packages on your system that PsyToolkit needs.

Here is a step by step guide for installing from source.

Step 1: Install needed packages on your Linux system

  • libusb

  • the SDL libraries: sdl, sdl_mixer, sdl_ttf, sdl_gfx, sdl_image (make sure you have installed the developer versions of these libraries as well, they sometimes come in separate packages, sometimes ending on "-dev"

  • indent

  • make

  • gcc

  • ruby

  • ruby-gtk2

  • imagemagick

  • closure-compiler

  • perl

  • parapin library

The parapin library is for using the parallel port. Although few people will use this, it is an option. If your system does not have a parapin package, do not worry, because there it comes with this package (see below).

Further, Inkscape is recommended for drawing stimuli.

Step 2: Download the latest source package

You can download the latest source file here:

Download it to your computer and unpack it. Your computer might do this automatically. If you want to do it on the command line, you would type the following:

tar xf psytoolkit.src.2.0.9.tar.gz

Then a new directory will be created, called psytoolkit_src

Step 3: Now ready to install

Type the following lines on the command line shell.

Todo this, you need to open a terminal. The > character at the beginning of the line is the shell prompt and should not be typed.
> cd psytoolkit_src
> sudo ./install.sh

The installation should not take long. The install file has some additional options, such as installing the parapin libraries, if you wish to do this, you could instead of the lines above type the following:

> cd psytoolkit_src
> sudo ./install.sh -p

Step 4: Test

It should now all work, so how can you test. Here are a few things you can do:

> man psycc

If you nothing happens, the manual pages of psycc are not installed, and something clearly went wrong.

Step 5: Optional: Finetune

The is a configuration file in /etc/psytoolkit. You can edit this file and comment the safety lock line. That way, you will be allowed to run experiments as superuser, which enables a few features. This is actually not necessary.

You need superuser rights to be allowed to open that file. If you are the on the command line, you can type the following (using the gedit editor many people will have installed by default):
> gedit /etc/psytoolkit/psytoolkit.1.9.8.conf
The current version is 2.0.9. For each installed PsyToolkit, you will have a different config file in /etc/psytoolkit.

Step 6: Optional: Play with and test the examples

PsyToolkit comes with a whole bunch of examples, including for the Cedrus keyboards. The are all in /usr/share/doc/psytoolkit.

Note that the current version of PsyToolkit is 2.0.9. Type the following to copy all the examples to your own home directory (otherwise, you cannot easily compile them and test them):

> cp -r /usr/share/doc/psytoolkit/2.0.9/examples/ ~/*

Now you can go into your home directory and test the examples, for example, for a very basic experiment, type in the following three lines:

> cd ~/examples/simon-spatial-compatibility/
> psycc -t simon.psy
> ./experiment