Solved: install PsychoPy 2023.1.1 on Ubuntu 22.04

This is for those who might be having problems installing PsychoPy 2023.1.1 on Ubuntu 22.04. After trying nearly all the options suggested on forums and the PsychoPy install page and failing, I finally got a fully functional PsychoPy install using the following steps:

  1. create a virtual env (12. Virtual Environments and Packages — Python 3.11.3 documentation)
  2. set the python version to 3.8 for the virtual env
    virtualenv --python=“/usr/bin/python3.8” “/path/to/new/virtualenv/” (3.8 must be installed)
  3. activate the virtual env source env/bin/activate
  4. download from GitHub (Releases · psychopy/psychopy · GitHub)
  5. extract PsychoPy from zip file
  6. pip install wx wheel for Ubuntu version (Index of /wxPython4/extras/linux/gtk3) I used pip install wxPython-4.1.1-cp38-cp38-linux_x86_64.whl
  7. cd to the PsychoPy folder and use command: ./ build
  8. when build completes, use command: ./ install
  9. pip install any missing modules causing install error. Fix with: python -m pip install “missing module” In general, for any failure due to a missing module during the install, install the missing module and then ./ install again

Note: you may need to install wxpython (wxPython · PyPI) or other modules - just follow the error messages

This approach also worked in a conda environment, with pip install as used in your example.

 conda create --name psychopy python=3.8 --solver=libmamba

I confirm that the recipe worked in a conda environment, created with python=3.8 (as suggested by Simon_Ruch), on my Debian bookworm system.

However, I did not need to install wxPython via a wheel. When running the command ./ install, version 4.2.0 of the wxPython module was downloaded and built. This needs the libgtk-3-dev package installed in the system. Supposing that the release tarball is unpacked in the PsychoPy-2023.1.2 directory, these are the commands that worked for me™:

sudo apt install libgtk-3-dev
conda create -n psychopy python=38
conda activate psychopy
cd PsychoPy-2023.1.2
./ build
pip install distro
pip install attrdict
./ install