psychopy.org | Reference | Downloads | Github

Can't access preferences or run experiments on Ubuntu 20.04

Hi. I’ve been trying to install PsychoPy on my Ubuntu 20.04 laptop. Installation process (PsychoPy, wxPython and PsychToolBox) was easy but the problems started afterwards. The first thing I noticed was that PsychoPy was not on the program list in the Ubuntu’s „main menu”. It was strange because last time I’ve installed it on Ubuntu, it was there. The program starts when run from the terminal but it has a glitch instead of the icon.

image

When I try to access preferences I get the following error message:

Traceback (most recent call last):
  File "/home/jakub/.local/lib/python3.9/site-packages/psychopy/app/themes/_themes.py", line 813, in _loadBitmap
    im = wx.Image(filename)
TypeError: Image(): arguments did not match any overloaded call:
  overload 1: too many arguments
  overload 2: argument 1 has unexpected type 'NoneType'
  overload 3: argument 1 has unexpected type 'NoneType'
  overload 4: argument 1 has unexpected type 'NoneType'
  overload 5: argument 1 has unexpected type 'NoneType'
  overload 6: argument 1 has unexpected type 'NoneType'
  overload 7: argument 1 has unexpected type 'NoneType'
  overload 8: argument 1 has unexpected type 'NoneType'
  overload 9: argument 1 has unexpected type 'NoneType'
  overload 10: argument 1 has unexpected type 'NoneType'
  overload 11: argument 1 has unexpected type 'NoneType'
  overload 12: argument 1 has unexpected type 'NoneType'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jakub/.local/lib/python3.9/site-packages/psychopy/app/_psychopyApp.py", line 754, in showPrefs
    prefsDlg = PreferencesDlg(app=self)
  File "/home/jakub/.local/lib/python3.9/site-packages/psychopy/app/preferencesDlg.py", line 557, in __init__
    self.populatePrefs()
  File "/home/jakub/.local/lib/python3.9/site-packages/psychopy/app/preferencesDlg.py", line 733, in populatePrefs
    icon = self.app.iconCache.getBitmap(choice.Text)
  File "/home/jakub/.local/lib/python3.9/site-packages/psychopy/app/themes/_themes.py", line 840, in getBitmap
    self._loadBitmap(name, theme, emblem=emblem, size=size)
  File "/home/jakub/.local/lib/python3.9/site-packages/psychopy/app/themes/_themes.py", line 815, in _loadBitmap
    raise FileNotFoundError("Failed to find icon name={}, theme={}, "
FileNotFoundError: Failed to find icon name=FlowTop_CompRight, theme=light, size=48, emblem=None

…and this appears in the terminal:

(psychopy:143936): Gtk-CRITICAL **: 13:37:27.275: gtk_widget_set_size_request: assertion 'width >= -1' failed

(psychopy:143936): Gtk-CRITICAL **: 13:37:27.276: gtk_widget_set_size_request: assertion 'width >= -1' failed

(psychopy:143936): Gtk-CRITICAL **: 13:37:27.280: gtk_widget_set_size_request: assertion 'width >= -1' failed

I’ve tried to use other python versions than my basic 3.8.5 (3.9.4 with PyGame, this alone was painful) but the result was the same. What am I missing here?

It wouldn’t be much of a problem but I that’s what I get when trying to run an experiment:

## Running: /home/jakub/OneDrive/Documents/Studia/Laboratorium psychologiczne/PsychoPy/Ćwiczenie I/task1_lastrun.py ##
12.5918     INFO     Loaded monitor calibration from ['2021_04_08 11:16']
pygame 2.0.1 (SDL 2.0.14, Python 3.9.4)
Hello from the pygame community. https://www.pygame.org/contribute.html
Error in function KbQueueCreate:     Incorrect argument type supplied
    Discrepancy between a specified and supplied argument:
        Specified Argument Description:
            direction: Input
            position: 6
            presence:
            formats allowed:
                unclassified
            minimum M: 1
            maximum M: 1
            minimum N: 1
            maximum N: 1
            minimum P: 1
            maximum P: 1
        Provided Argument Description:
            direction: Input
            position: 6
            presence: present
            format: int64
            number of dimensions: 0
                 M: 1
                 N: 1
                 P: 1
PsychHID:KbQueueCreate: Usage:

PsychHID('KbQueueCreate', [deviceNumber][, keyFlags=all][, numValuators=0][, numSlots=10000][, flags=0][, windowHandle=0])
0.3767     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).
4.1847     WARNING     User requested fullscreen with size [1024  768], but screen is actually [1920, 1080]. Using actual size
/home/jakub/.local/lib/python3.9/site-packages/pandas/compat/__init__.py:97: UserWarning: Could not import the lzma module. Your installed Python is incomplete. Attempting to use lzma compression will result in a RuntimeError.
  warnings.warn(msg)
Traceback (most recent call last):
  File "/home/jakub/OneDrive/Documents/Studia/Laboratorium psychologiczne/PsychoPy/Ćwiczenie I/task1_lastrun.py", line 81, in <module>
    defaultKeyboard = keyboard.Keyboard()
  File "/home/jakub/.local/lib/python3.9/site-packages/psychopy/hardware/keyboard.py", line 166, in __init__
    buffer = _keyBuffers.getBuffer(devId, bufferSize)
  File "/home/jakub/.local/lib/python3.9/site-packages/psychopy/hardware/keyboard.py", line 355, in getBuffer
    self[kb_id] = _KeyBuffer(bufferSize=bufferSize,
  File "/home/jakub/.local/lib/python3.9/site-packages/psychopy/hardware/keyboard.py", line 397, in __init__
    self.dev = hid.Keyboard(kb_id)  # a PTB keyboard object
  File "/home/jakub/.local/lib/python3.9/site-packages/psychtoolbox/hid.py", line 137, in __init__
    self._create_queue(buffer_size)
  File "/home/jakub/.local/lib/python3.9/site-packages/psychtoolbox/hid.py", line 144, in _create_queue
    PsychHID('KbQueueCreate', self.device_number,
TypeError: Incorrect argument type supplied
##### Experiment ended. #####

…no matter what python version I use. What can I do to get it to work?

For the PsychHID issue, downgrading to 3.0.16 should fix it until it actually gets fixed. :wink:

Could you hint me how can I do that?

pip uninstall psychtoolbox
pip install psychtoolbox==3.0.16

Thank you. After downgrading I got a different error message, so I followed a suggestion in this thread and uninstalled psychtoolbox completely. It has helped, now I can run experiments, but I still can’t access preferences (the error message is the same as before) and the icon is still a glitch. Do I lack some libraries? Should I reinstall something? Should I report it somewhere?

OK, I made it!
I don’t know why, but two icon files in my light, dark and classic folders in app/Resources were named wrongly. They were named „flowtop_compright.png” and „flowtop_compleft.png” but the program demanded „FlowTop_CompRight.png” and „FlowTop_CompLeft.png” with the capitals! So I’ve changed the names of the files to their proper version and now I can access the preferences menu. Might be a bug, because the FlowBottom icons are named correctly. So that, combined with uninstalling psychtoolbox (thank you, @sol), has solved my problem.