| Reference | Downloads | Github

Trying to get PsychPy 3.2.2 working with Ubuntu 18.04 Wayland

Hi there
Ive installed PyschoPy 3.2.2 in ubuntu 18.04 running Waylander ( I have 300+ lab pcs running this with no issues to date ) Its imported into and run from within PyCharm ( 2019-2) Ive also installed pyglet-1.3.2 which it uses
If I run a very quick test program from a lecturer i get the below message. If I run it in xorg it works fine.
Does anyone know whether its possible to get PyschoPy running in the above manner, using Ubuntu 18.04 Waylander. Theres no way at this stage that I can reinstall Xorg on 300+ pcs, but it’d be a shame to drop this library. Any ideas very much appreciated.

1.9566 WARNING The size of the gamma ramp was reported as 0. This can mean that gamma settings have no effect. Proceeding with a default gamma ramp size.
Traceback (most recent call last):
File “/home/newmart/.PyCharmCE2019.2/config/scratches/”, line 8, in
color=[1, 1, 1]
File “/usr/local/lib/python3.6/dist-packages/psychopy/visual/”, line 416, in init
self.backend = backends.getBackend(win=self, *args, **kwargs)
File “/usr/local/lib/python3.6/dist-packages/psychopy/visual/backends/”, line 32, in getBackend
return Backend(win, *args, **kwargs)
File “/usr/local/lib/python3.6/dist-packages/psychopy/visual/backends/”, line 239, in init
self._origGammaRamp = self.getGammaRamp()
File “/usr/local/lib/python3.6/dist-packages/psychopy/visual/backends/”, line 347, in getGammaRamp
self.screenID, self.xDisplay, gammaErrorPolicy=self._gammaErrorPolicy
File “/usr/local/lib/python3.6/dist-packages/psychopy/visual/backends/”, line 192, in getGammaRamp
raise OSError(raise_msg.format(func=func))
OSError: The hardware look-up table (XF86VidModeGetGammaRamp) was unable to be used. If you would like to proceed without look-up table (gamma) changes, you can set the Window parameter gammaErrorPolicy to "warn" or "ignore".
Exception ignored in: <bound method Window.del of <psychopy.visual.window.Window object at 0x7fd44bed1978>>
Traceback (most recent call last):
File “/usr/local/lib/python3.6/dist-packages/psychopy/visual/”, line 529, in del
File “/usr/local/lib/python3.6/dist-packages/psychopy/visual/”, line 1517, in close
self.backend.close() # moved here, dereferencing the window prevents
AttributeError: ‘NoneType’ object has no attribute ‘close’

I must admit that I know very little about the different Linux GUIs and Linux in general, but I installed psychopy on Ubuntu 18.4 (Gnome/Xorg, though) recently and saw a lot of errors until I finally had everything running.
Unfortunately I have not recorded any error I encountered and its final cure, but I think I also received the message you are describing, and if I am not mistaken it came from the wrong version of wxpython. Psychopy seems to demand something greater than 4.0, but when I just installed the latest 4.06 I got errors.
The only version that worked for me was 4.02 from
Maybe you can give that a try, and please bear with me, if my memory confused something.

It is a bit buried in the error message, but the following might allow it to run (without gamma support):

"OSError: The hardware look-up table (XF86VidModeGetGammaRamp) was unable to be used. If you would like to proceed without look-up table (gamma) changes, you can set the Window parameter gammaErrorPolicy to "warn" or "ignore" .

I.e., open the window with gammaErrorPolicy="ignore".

Thanks Detlef,
Many thanks for the reply. Yes I tried various versions of wxpython, including that one, but it didnt solve the problem. However the suggestion from djmannion does work around it nicely, so hopefully this will be acceptable to the user. Many thanks for suggestion

HI djmannion,
Many thanks , I noticed just yesterday pm before leaving that this suppresses all of the red errors, and your reply adds to my confidence , so many thanks. Ive now gone back to the Lecturer, and if they can live with that, we should be fine for this year. Long term, we may need to look at Xorg instead of Waylander, but hopefully this should suffice for now. Many thanks for your help

I’m getting this error on a Windows PC and a laptop and I don’t know how to set gammaErrorPolicy="ignore" in PsychoPy builder. However, I can get PsychoPy to run if I deactivate my second monitor.

Best wishes,


Hi wakecarter
Im running psychopy within pycharm so:
I just got users to add the below line (gammaErrorPolicy=“ignore”,) each time they use the psychopy.visual.Window command , and it works for their needs ( ie gets rid of the red error warnings )

import psychopy.visual
import psychopy.event
import time

win = psychopy.visual.Window(
    size=[400, 400],