PsychoPy
Introduction
PsychoPy is an open-source, Python based software package used for creating behavioral experiments. It features and easy to use graphical user interface. PsychoPy can be used for online research in combination with Pavlovia.
Availability, support and advice
PsychoPy comes preinstalled on labcomputers in the FSW (see the Software List to check which version). PsychoPy can be requested for work PC's via the ISSC Helpdesk. For unmanaged/personal computers PsychoPy can be downloaded here. SOLO provides only very limited basic support for PsychoPy.
Markers
To send markers with PsychoPy using the UsbParMarker or EVA, the python_markers library can be used, see Github: solo-fsw/python-markers. To use the python_markers library, place the python_markers folder in the same location as your PsychoPy task, and implement the code as described in example.py in your task. The python_markers folder can be downloaded by downloading or cloning the python_markers repo.
Eye Tracking
The installation of PsychoPy on the lab PCs at SSH Leiden include the necessary libraries for eye tracking with Tobii and EyeLink. See for more information about incorporating eye tracking in your PsychoPy experiment: Communicating with an Eyetracker — PsychoPy v2024.2.4.
Online
Psychopy offers the option to auto-translate your python code into JavaScript (or manually add JS), so that the experiment can be run online in combination with Pavlovia. However, you should be aware that not all features are available online, and that bugs still frequently occur. For a running overview of these issues, please consult the developer crib sheet and the forum.
Tips & Tricks
Syncing to Pavlovia from network drives.
Psychopy has the functionality to upload and sync (JavaScript compatible) experiments directly to Pavlovia.org.
Testing shows that this functionality works properly if the project files are located on the local C-drive. However, in some cases it does not work if the if the experiment folder/files are located on the network drive (e.g. in the P-drive). Throwing the following error:
By default, any project located on the P-drive will show the \\VUW\.. path when initially creating the project on Pavlovia from Builder:
There are two workarounds.
Change this default path when first syncing to the shorter P:\ or J:\ notation, e.g.:
\\VUW\Personal$\Homes\O\olferskjf\My Documents\Packaging\Psychopy\Experiments\BART
to
P:\My Documents\Packaging\Psychopy\Experiments\BART
You can do this manually, or by clicking on the "Browse" button and navigating to the desired location.- If the above does not fix the problem, move your experiment folder to the local (C) drive, and open it from there and then sync to Pavlovia.
FAQ
Topic | Question | Answer |
---|---|---|
Error when syncing to Pavlovia | when creating a new project on pavlovia from the builder (or syncing to it), an error is thrown ending with "stderr: 'fatal: remote origin already exists". | The workaround is placing your files on the local drive (instead of P or J-drive) or adjusting the default path. See here for further details. |
Blank screen when running study in local browser | Running a JS study in the local browser, using the button in the builder, only shows an empty screen in the browser. | Make sure adblockers (like Ublock origin) are disabled or set to ignore http://localhost:12002/ |
2022.2.2 not syncing to Pavlovia | After installing the 2022.2.2 version, my experiments no longer sync properly to Pavlovia. | In Experiment settings, make sure "Use PsychoPy version" is set to 2022 or 2022.2.2 |
Resources
Packaging
When | Target | Report | Comments |
10-09-2021 | Work-pc / Software Center | Syncing to pavlovia from network drives does not work by default. For solution see here. | |
30-08-2022 | Work-pc / Software Center | Adds some useful features (e.g. testing in local browser) and seems to have fixed the sync from network . |