How to install PsychoPy 2022.1.4 on Ubuntu 22.04

Thanks for this thread, the official Linux installation documentation is indeed woefully out of date.

I am using Python 3.9 on AlmaLinux 8, so the below should work on any RHEL 8 compatible distro (Rocky, CentOS, etc). I am also using a virtual environment, as above.

version=2022.1.4

# Dependencies needed on my system - yours may differ:
sudo dnf install -y gcc-c++ swig python39-devel pulseaudio-libs-devel alsa-lib-devel wxGTK3-devel webkit2gtk3-devel
# These packages are only needed for the installation, and can safely be removed afterwards, except for python39.

# Virtual environment for Python:
python3.9 -m venv psychopy-$version
. psychopy-$version/bin/activate
pip install --upgrade pip

# Install PsychoPy:
pip install psychopy==$version
pip install wxpython # This is super-slow to compile!

# I use this to give priority without having to make any system-wide changes:
cp -p --remove-destination `readlink -f \`which python3\`` `which python3`
sudo setcap cap_sys_nice=eip `which python3`

# Now to run PsychoPy, use:
. psychopy-$version/bin/activate
psychopy --builder &
1 Like