psychopy.org | Reference | Downloads | Github

Can't install on ubuntu 20

Dear friends

I created the psychopy environment and installed libwebkitgtk but still when I run an experiment after a second showing a first screen I get this error in terminal:

(psychopy:6687): Gtk-CRITICAL **: 17:14:07.726: render_fallback_image: assertion ‘pixbuf != NULL’ failed

(psychopy:6687): GLib-GObject-CRITICAL **: 17:14:07.726: g_object_ref: assertion ‘G_IS_OBJECT (object)’ failed

and this error in psychopy runner:
PsychHID: KbQueueStart: Failed to switch to realtime priority [Operation not permitted].
Fatal Python error: (pygame parachute) Segmentation Fault

Current thread 0x00007f10c928f740 (most recent call first):
File “/home/ad/untitled_lastrun.py”, line 85 in

Your help is much appreciated!

Hi,

I’ve also tried several ways to install Psychopy on Ubuntu (different releases), and Debian too with no luck whatsoever. Although I think I have a certain experience with Linux, at the end of the story I had to go for Windows.
It’s really too bad, but at this very moment I think that trying to install Psychopy on a Linux-based system is just a waste of time. Don’t do that.

paolo

That’s really unfortunate!

Sorry that this 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

Thank you for the instructions.

Once I commanded ‘psychopy’ to run the program, I got the response below. Do you think I might not did your instructions correctly?
Traceback (most recent call last):
File “/home/ad/anaconda3/bin/psychopy”, line 8, in
sys.exit(main())
File “/home/ad/anaconda3/lib/python3.8/site-packages/psychopy/app/psychopyApp.py”, line 100, in main
start_app()
File “/home/ad/anaconda3/lib/python3.8/site-packages/psychopy/app/psychopyApp.py”, line 22, in start_app
from psychopy.app._psychopyApp import PsychoPyApp
File “/home/ad/anaconda3/lib/python3.8/site-packages/psychopy/app/_psychopyApp.py”, line 13, in
from psychopy.app.colorpicker import PsychoColorPicker
File “/home/ad/anaconda3/lib/python3.8/site-packages/psychopy/app/colorpicker/init.py”, line 8, in
import wx
File “/home/ad/anaconda3/lib/python3.8/site-packages/wx/init.py”, line 17, in
from wx.core import *
File “/home/ad/anaconda3/lib/python3.8/site-packages/wx/core.py”, line 12, in
from ._core import *
ImportError: /lib/x86_64-linux-gnu/libpangoft2-1.0.so.0: undefined symbol: hb_ot_metrics_get_position

@Aliadelik07 You’re using a conda python installation whereas I was using the standard python. Based on your error, it looks like the conda python has a very broken installation of wxPython if it can’t even do import wx. I’m afraid I can’t help you with that

@Aliadelik07 I had similar trouble installing Psychopy on Ubuntu with conda. So far it seems to be working, at least I’m able to import wx, but I haven’t done much else with it.

What didn’t work:
The pip install instructions in the wx documentation don’t work with conda, and I think this is because the python version included with conda isn’t configured to allow shared external libraries (see the wx known issues). And it doesn’t look like that will be changing anytime soon (link).

Also the prebuilt wheels at https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ don’t seem to work, although I’ve no idea why. It just says I don’t have the correct version of Ubuntu.

What did work:
The version of conda I’m using does appear to have it’s own wxPython that works. Below are my version details. Maybe check if you’re working in an updated version of conda?

  • Ubuntu 20.04 (LTS)
  • conda 4.10.1
  • Python 3.6.13

Then in the terminal:

conda activate myenv
conda install wxPython

Edit: @jon is right that the wxPython is conda seems to be badly broken. I’m able to import but creating multiple dialogue boxes causes fatal errors. Sorry I couldn’t be more help!

1 Like