psychopy.org | Reference | Downloads | Github

Unable to properly install psychopy on Ubuntu 20.04

Hello,
I’m trying to install and launch psychopy on Ubuntu 20.04. I’ve seen that the last package (through apt package manager) is the last version so I’ve insalled it with apt install psychopy. When I launch it I get some python dependency errors so I’ve installed all libraries with pip3 install psychopy. Now I have psychopy 2020.1.3 installed but when I launch it from terminal I get:

filippogambarota@filippo-pc:~$ psychopy
05:36:22 PM: Debug: Adding duplicate image handler for 'Windows bitmap file'
05:36:22 PM: Debug: Adding duplicate image handler for 'Windows bitmap file'
05:36:22 PM: Debug: Adding duplicate image handler for 'Windows bitmap file'

How can I do?

Hi, I am having the same issue. Did you manage to resolve this?

I found this thread here that describes the same issue on Ubuntu 18.04: Installing psychopy on Linux

However, I cannot work out how to view the log described here:

  1. run python -c "from psychopy import prefs; print(prefs.paths['userPrefsDir'])" to find where your psychopy directory is
  2. look at the contents of last_app_load.log in that directory
  3. in my case, it showed me the true error: libwebkitgtk-1.0-0 was missing, so: sudo apt-get install libwebkitgtk-1.0-0
  4. after that it errored again because it didn’t find any sound library. I fixed that with pip install pygame

And either way it sounds like libwebkitgtk is no longer available anyway

I am trying to install PsychoPy on Ubuntu 20, the problem is that I cannot install libwebkitgtk. Apparently it is not available. I could manually install it but it has some dependencies that are not available either (e.g. libjavascriptcoregtk-1.0-0, libicu60). I am not sure I am getting into a rabbit hole here. Is there an easier way to solve this issue and have psychopy running on my system?

Hi! in reality I’ve stopped my attempts and I’m working on a windows machine now. I tried both on Ubuntu 18.04 and 20.04 but without success. Maybe with other methods (conda) this should work

Yes same here!

Did you manage to find a solution?

Hi, no sorry, I gave up and went back to Windows.

Very sad. This issue exists over 1 year, see for example this case: 8223.
Tried today with most recent conda and yml, but again, same fail.
Psychopy is just not compatible with recent Linuxes, yet.

Oh, wait, changelog looks promising:

support for wxPython 4.1

No, I had the most recent already:

psychopy -v
PsychoPy3, version 2020.2.2 ©Jonathan Peirce 2018, GNU GPL license

Sorry that installing on Debian/Ubuntu hasn’t been easier. I’m afraid the core team developing PsychoPy is very small and busy!

That said, I just tried to install on a VM running a clean install of Ubuntu 20.04 and this appears to work:

sudo apt-get install psychopy   # fetches outdated version from debian
sudo apt-get install python3-pip python3-wxgtk-webview4.0 
# update to latest psychopy:
pip3 install -U psychopy  
 # fix some incompatible lib versions:
pip3 install cffi==1.14.0 psychtoolbox==3.0.16 

Those 4 lines should be enough that you can now start PsychoPy and edit experiments!

To get psychtoolbox working for keyboard use you also need the following steps to raise the priority of the experiment process:

sudo groupadd --force psychtoolbox
sudo usermod -a -G psychtoolbox $USER

then do sudo nano /etc/security/limits.d/99-psychopylimits.conf and copy/paste in the following text to that file:

@psychtoolbox   -  nice       -20
@psychtoolbox   -  rtprio     50
@psychtoolbox   -  memlock    unlimited

Thanks all those that contributed to the above lines in one way or another :slight_smile: