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 PsychoPy-2023.1.1.zip 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: ./setup.py build
  8. when build completes, use command: ./setup.py 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 ./setup.py install again

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

3 Likes

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 ./setup.py 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
./setup.py build
pip install distro
pip install attrdict
./setup.py install

I am using Linux Mint 21.3 (based on Ubuntu 22.04). The suggested method did not work for me. I followed Rafael’s steps and get the following error during execution of ./setup.py install

tmp/easy_install-18j9_ehv/tables-3.9.2/temp/H5close23v0l0ld.c:1:10: fatal error: H5public.h: No such file or directory
1 | #include “H5public.h”
| ^~~~~~~~~~~~
compilation terminated.
… ERROR:: Could not find a local HDF5 installation.
You may need to explicitly state where your local HDF5 headers and
library can be found by setting the HDF5_DIR environment
variable or by using the --hdf5 command-line option.
error: Setup script exited with 1

Any help will be appreciated. Thanks.

FWIW, I couldn’t make Catherine’s solution to work – it always stumbled over the pip installation of esprima.
But Simon’s/Rafael’s suggestions worked out in the end. After installing a lot of extra needed packages with pip, PsychoPy started up but complained about not finding GLIBCXX_3.4.30. This could be fixed with
conda install -c conda-forge libstdcxx-ng
(found at https://stackoverflow.com/questions/73836387/how-to-fix-glibcxx-3-4-30-not-found-in-ubuntu-22-04, the bottom 0-rated answer).

So now PsychoPy 2023.1.3 (yes, I only realized afterwards I didn’t work with the exact same version as either Catherine or Rafael…) is happily up and running on Debian 12/bookworm, with amd64 kernel 6.6.13, X-Windows and Qt 5.15.8.

Thank you all!

P.S.: Installation worked even more smoothly with the latest PsychoPy version, 2024.1.4.
Just pip install . did it all.

1 Like

I’m using Ubuntu 24.04 LTS and Psychopy 2024.2.4
I tried conda env and failed
I tried python -m venv and failed
I tried pip install . and failed
I tried Python 3.8 3.9 3.10 and failed
I tried Psychopy’s own instructions and failed
I asked God, Jesus, David, and Muhammad for help and they ignored me like always
Finally, I found this dude providing AN EXCELLENT INSTALLER on GITHUB that INSTALLS PSYCHOPY on UBUNTU with ONLY ONE COMMAND

Here’s the proof that this dude is probably a prophet, God or something of that sort.

1 Like

For whatever reason (new kernel?) My own solution no longer worked when I needed to install PsychoPy again. About 6 months ago when I had tried the install script that alisamie97 suggested (GitHub - wieluk/psychopy_linux_installer: Installing PsychoPy on Linux can be challenging, so I've created an installer to make the process easier and more streamlined.) I got errors and couldn’t get PsychoPy to install. However, today, using Ubuntu 22.04 with kernel 6.12.3-061203-generic, I was able to install PsychoPy 2024.2.5 using python 3.10. I used the latest version of the script (v1.4.3) and installed using the defaults. This was by far the easiest PsychoPy install, and I was frankly surprised when it worked. I’m not sure how robust this will be against upgrades and updates, but there does seem to be hope.

1 Like

OS : Ubuntu 24.04
PsychoPy version : PsychoPy 2024.2.4
**Standard Standalone? : yes

I had issues to install PsychoPy 2024.2.4 on my laptop running Ubuntu 24.04 so I used this installer as suggested : (GitHub - wieluk/psychopy_linux_installer: Installing PsychoPy on Linux can be challenging, so I've created an installer to make the process easier and more streamlined.). PsychoPy is almost working fine but I can not manage to connect to my Pavlovia account from the Builder, if I click Create a project or Sync, PsychoPy closes/crashes without a error message. Would you know how to fix this ?

OS: Lubuntu 22.04
PSychoPy version: 2024.2.5 on Python 10

Same here - here is the error message I get when I try to create a Pavlovia project. I tried duckduckgoing for a solution but no luck.

UPDATE: Not ideal but you can manually sync your project with gitlab. I was successful doing so following Jon’s advice Pavlovia ssh -T asks for password - #26 by jon as ssh keys do not seem to work

Hi,

Yaroslav forwarded me an email containing a link to this discussion. I’m the creator of the installer script.

It would greatly help me—and everyone using the script—if you could report any issues, such as the Pavlovia login problem, in the GitHub issues section. Please include detailed information about your OS, software versions, and precise steps to reproduce the issue.

I’ve briefly looked into the Pavlovia issue and am not yet sure if it’s related to the installer or PsychoPy itself. Reporting it as a GitHub issue would still be very helpful, so I can keep track of it and investigate further.

I perform automated testing, but this currently covers only basic functionality and running a test paradigm, not GUI-specifics such as Pavlovia interactions. Testing across multiple Linux distributions and four different package managers is challenging, especially as I actively use only one distribution and a limited subset of PsychoPy’s capabilities. For example, I’ve successfully logged into Pavlovia on Linux but haven’t tested creating or syncing projects.

Indeed, on Linux (Debian-based distros at least) someone can enable login by installing libwebkit2gtk. But once you try to create a Pavlovia project PsychoPy crashes.

If you find a solution that fixes this from the installer side, I can implement it. However, debugging this without any logging in last_app_load.log is quite challenging. This might be something that needs to be fixed in PsychoPy itself rather than on the user or installer side. I recommend opening an issue on the PsychoPy GitHub to track and address this properly.