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

1 Like

Yes same here!

1 Like

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 (c)Jonathan Peirce 2018, GNU GPL license

1 Like

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:

3 Likes

Hi Jon! do you think that this installation snippet could be adapted also for ubuntu 21.04? I have tried it but there are several errors…

1 Like

Hi Jon and FIlipp,

I am also having some troubles installing Psychopy correctly in Ubuntu 21.04. Any suggestion?

I followed the guidelines in the site web and also tried the lines copied by Jon, but I can’t open psychopyApp.

Thanks in advance!

Fer

Hi @ferluna90 @filippogambarota I haven’t tried to install on 21.04 myself yet. I’d suggest you open that as a separate discussion thread. As a general rule, if there are errors it really helps if you tell us what those errors are (the entire trace)

1 Like

No errors are shown. The program simply crashes immediately upon starting. No errors or messages are shown.

PsychoPy tries to save a log of any messages whilst loading. Is anything being stored in that?
I think on ubuntuyou could check with:

cat ~/.psychopy3/last_app_load.log

but you might need to tweak the file location

1 Like

Hey There!

I’m having the same issue with Ubuntu (Focal). I had it working on a previous install last fall, but I can’t seem to get the right dependencies this time around. This is the lastest error

ImportError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33’ not found (required by /home/imolax/.local/lib/python3.8/site-packages/wx/libwx_gtk3u_core-3.2.so.0)

It looks like 2.33 is not available for Ubuntu and that 2.31 is the latest.

Any advice would be much appreciated!

Were there any more lines to this error message that might indicate what was trying to import glibc 2.33?

There’s a lot here, so apologies in advance. There are also issues with pyopenssl and cryptography.

Traceback (most recent call last):
  File "/home/imolax/.local/bin/psychopy", line 8, in <module>
    sys.exit(main())
  File "/home/imolax/.local/lib/python3.8/site-packages/psychopy/app/psychopyApp.py", line 98, in main
    start_app()
  File "/home/imolax/.local/lib/python3.8/site-packages/psychopy/app/psychopyApp.py", line 26, in start_app
    app = startApp(showSplash=showSplash)
  File "/home/imolax/.local/lib/python3.8/site-packages/psychopy/app/__init__.py", line 84, in startApp
    from psychopy.app._psychopyApp import PsychoPyApp
  File "/home/imolax/.local/lib/python3.8/site-packages/psychopy/app/_psychopyApp.py", line 10, in <module>
    from psychopy.app.colorpicker import PsychoColorPicker
  File "/home/imolax/.local/lib/python3.8/site-packages/psychopy/app/colorpicker/__init__.py", line 9, in <module>
    import wx
  File "/home/imolax/.local/lib/python3.8/site-packages/wx/__init__.py", line 17, in <module>
    from wx.core import *
  File "/home/imolax/.local/lib/python3.8/site-packages/wx/core.py", line 12, in <module>
    from ._core import *
ImportError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /home/imolax/.local/lib/python3.8/site-packages/wx/libwx_gtk3u_core-3.2.so.0)
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 72, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
    from apport.report import Report
  File "/usr/lib/python3/dist-packages/apport/report.py", line 32, in <module>
    import apport.fileutils
  File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 12, in <module>
    import os, glob, subprocess, os.path, time, pwd, sys, requests_unixsocket
  File "/usr/lib/python3/dist-packages/requests_unixsocket/__init__.py", line 1, in <module>
    import requests
  File "/usr/lib/python3/dist-packages/requests/__init__.py", line 95, in <module>
    from urllib3.contrib import pyopenssl
  File "/usr/lib/python3/dist-packages/urllib3/contrib/pyopenssl.py", line 46, in <module>
    import OpenSSL.SSL
  File "/home/imolax/.local/lib/python3.8/site-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import SSL, crypto
  File "/home/imolax/.local/lib/python3.8/site-packages/OpenSSL/SSL.py", line 19, in <module>
    from OpenSSL.crypto import (
  File "/home/imolax/.local/lib/python3.8/site-packages/OpenSSL/crypto.py", line 3253, in <module>
    utils.deprecated(
TypeError: deprecated() got an unexpected keyword argument 'name'

Original exception was:
Traceback (most recent call last):
  File "/home/imolax/.local/bin/psychopy", line 8, in <module>
    sys.exit(main())
  File "/home/imolax/.local/lib/python3.8/site-packages/psychopy/app/psychopyApp.py", line 98, in main
    start_app()
  File "/home/imolax/.local/lib/python3.8/site-packages/psychopy/app/psychopyApp.py", line 26, in start_app
    app = startApp(showSplash=showSplash)
  File "/home/imolax/.local/lib/python3.8/site-packages/psychopy/app/__init__.py", line 84, in startApp
    from psychopy.app._psychopyApp import PsychoPyApp
  File "/home/imolax/.local/lib/python3.8/site-packages/psychopy/app/_psychopyApp.py", line 10, in <module>
    from psychopy.app.colorpicker import PsychoColorPicker
  File "/home/imolax/.local/lib/python3.8/site-packages/psychopy/app/colorpicker/__init__.py", line 9, in <module>
    import wx
  File "/home/imolax/.local/lib/python3.8/site-packages/wx/__init__.py", line 17, in <module>
    from wx.core import *
  File "/home/imolax/.local/lib/python3.8/site-packages/wx/core.py", line 12, in <module>
    from ._core import *
ImportError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /home/imolax/.local/lib/python3.8/site-packages/wx/libwx_gtk3u_core-3.2.so.0)

Thanks - that’s what we needed. It looks like a broken wxPython library. How did you install that?

Hi @imolax,

Perhaps this installation instructions will interest you.

Best regards

Sorry for the delay @jon! Most dependencies came pre-installed or were called on by Pyschopy as far as I can tell. This is a brand new Lenovo Thinkpad computer with a factory install of Ubuntu.

Any advice is greatly appreciated!

Update: after a lot of searching, I’m starting to think it’s a pyOpenSSL and cryptography issue. While not identical, there are there applications causing similar errors:

These issues started after I tried the psychopy install suggested above in this thread, and I’m wondering if there is anything in that code that calls on incompatible upgrades?

If this is beyond the scope of a psychopy install, no worries. I may just need to reformat/reinstall Ubuntu. It’s affecting apps well beyond pyschopy.