Troubles with sychopy on Ubuntu 20.04.2 LTS

Hi everyone,

I’m trying to install Psychopy on Ubuntu 20.04… At first I tried the pip installation procedure and the conda procedure as well. Both installations went on quite smoothly, but unfortunately I cannot run Psychopy. I’ve also read all Ubuntu-related messages here, trying to figure out any missing library or so, but with no luck.
Here’s the error message I get when launching Psychopy from outside conda:

Traceback (most recent call last):
File “/home/laboratorio/anaconda3/bin/psychopy”, line 8, in
sys.exit(main())
File “/home/laboratorio/anaconda3/lib/python3.8/site-packages/psychopy/app/psychopyApp.py”, line 100, in main
start_app()
File “/home/laboratorio/anaconda3/lib/python3.8/site-packages/psychopy/app/psychopyApp.py”, line 22, in start_app
from psychopy.app._psychopyApp import PsychoPyApp
File “/home/laboratorio/anaconda3/lib/python3.8/site-packages/psychopy/app/_psychopyApp.py”, line 24, in
from . import themes
File “/home/laboratorio/anaconda3/lib/python3.8/site-packages/psychopy/app/themes/init.py”, line 1, in
from ._themes import ThemeMixin, IconCache
File “/home/laboratorio/anaconda3/lib/python3.8/site-packages/psychopy/app/themes/_themes.py”, line 5, in
import wx
File “/home/laboratorio/anaconda3/lib/python3.8/site-packages/wx/init.py”, line 17, in
from wx.core import *
File “/home/laboratorio/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

And here’s what I get launching Psychopy from within the coda environment:

pygame 2.0.1 (SDL 2.0.14, Python 3.6.12)
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
File “/home/laboratorio/anaconda3/envs/psychopy/bin/psychopy”, line 11, in
sys.exit(main())
File “/home/laboratorio/anaconda3/envs/psychopy/lib/python3.6/site-packages/psychopy/app/psychopyApp.py”, line 100, in main
start_app()
File “/home/laboratorio/anaconda3/envs/psychopy/lib/python3.6/site-packages/psychopy/app/psychopyApp.py”, line 22, in start_app
from psychopy.app._psychopyApp import PsychoPyApp
File “/home/laboratorio/anaconda3/envs/psychopy/lib/python3.6/site-packages/psychopy/app/_psychopyApp.py”, line 56, in
from .utils import FileDropTarget
File “/home/laboratorio/anaconda3/envs/psychopy/lib/python3.6/site-packages/psychopy/app/utils.py”, line 25, in
from . import pavlovia_ui
File “/home/laboratorio/anaconda3/envs/psychopy/lib/python3.6/site-packages/psychopy/app/pavlovia_ui/init.py”, line 19, in
from .functions import *
File “/home/laboratorio/anaconda3/envs/psychopy/lib/python3.6/site-packages/psychopy/app/pavlovia_ui/functions.py”, line 13, in
from ._base import PavloviaMiniBrowser, PavloviaCommitDialog
File “/home/laboratorio/anaconda3/envs/psychopy/lib/python3.6/site-packages/psychopy/app/pavlovia_ui/_base.py”, line 9, in
import wx.html2
File “/home/laboratorio/anaconda3/envs/psychopy/lib/python3.6/site-packages/wx/html2.py”, line 15, in
from ._html2 import *
ImportError: libwebkitgtk-1.0.so.0: cannot open shared object file: No such file or directory
3.9587 WARNING We strongly recommend you activate the PTB sound engine in PsychoPy prefs as the preferred audio engine. Its timing is vastly superior. Your prefs are currently set to use [‘sounddevice’, ‘PTB’, ‘pyo’, ‘pygame’] (in that order).

Thank you for any help.

Paolo

According to this post about a different project, Ubuntu 20.04 may not include libwebkitgtk-1.0 like previous versions did. The simpliest suggest fix I saw was to try installing the missing lib using:

sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu bionic main universe'
sudo apt install -t bionic libwebkitgtk-1.0-0

Thank you very much, Sol, after installing the old lib, I can run Psychopy within the conda environment!! Actually, I still can’t run it from outside conda, but… so far so good.

paolo

I’m liking anaconda on linux, it makes it easy to have python 3.6 and 3.8 env’s side by side and seems to reduce the chances of conflicts (for lack of a better word) with the system python version installed.

1 Like