How To Install psychopy on Ubuntu 22.04

In this tutorial we learn how to install psychopy on Ubuntu 22.04. psychopy is environment for creating psychology stimuli in Python

Introduction

In this tutorial we learn how to install psychopy on Ubuntu 22.04.

What is psychopy

psychopy is:

PsychoPy provides an environment for creating psychology stimuli using Python scripting language. It combines the graphical strengths of OpenGL with easy Python syntax to give psychophysics a free and simple stimulus presentation and control package.

The goal is to provide, for the busy scientist, tools to control timing and windowing and a simple set of pre-packaged stimuli and methods. PsychoPy features

  • IDE GUI for coding in a powerful scripting language (Python)
  • Builder GUI for rapid development of stimulation sequences
  • Use of hardware-accelerated graphics (OpenGL)
  • Integration with Spectrascan PR650 for easy monitor calibration
  • Simple routines for staircase and constant stimuli experimental methods as well as curve-fitting and bootstrapping
  • Simple (or complex) GUIs via wxPython
  • Easy interfaces to joysticks, mice, sound cards etc. via PyGame
  • Video playback (MPG, DivX, AVI, QuickTime, etc.) as stimuli

There are three methods to install psychopy on Ubuntu 22.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install psychopy Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install psychopy using apt-get by running the following command:

sudo apt-get -y install psychopy

Install psychopy Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install psychopy using apt by running the following command:

sudo apt -y install psychopy

Install psychopy Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install psychopy using aptitude by running the following command:

sudo aptitude -y install psychopy

How To Uninstall psychopy on Ubuntu 22.04

To uninstall only the psychopy package we can use the following command:

sudo apt-get remove psychopy

Uninstall psychopy And Its Dependencies

To uninstall psychopy and its dependencies that are no longer needed by Ubuntu 22.04, we can use the command below:

sudo apt-get -y autoremove psychopy

Remove psychopy Configurations and Data

To remove psychopy configuration and data from Ubuntu 22.04 we can use the following command:

sudo apt-get -y purge psychopy

Remove psychopy configuration, data, and all of its dependencies

We can use the following command to remove psychopy configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge psychopy

References

Summary

In this tutorial we learn how to install psychopy package on Ubuntu 22.04 using different package management tools: apt, apt-get and aptitude.