psychopy.org | Reference | Downloads | Github

Error with pyglet when running on Linux Mint 19

I’m getting the following error while I run my code on a computer running in Linux Mint 19. I’ve previously ran this code on 2 separate Macs and it worked fine. Which makes me think that this might have something to do with Linux Mint itself (or how I set it up). Any clue how I can resolve this issue?

Traceback (most recent call last): File "image_slideshow.py", line 665, in <module> run() File "image_slideshow.py", line 631, in run pre_slide(1) File "image_slideshow.py", line 187, in pre_slide pre_slide_wait_screen(win) File "image_slideshow.py", line 171, in pre_slide_wait_screen win.flip() File "/home/danckertlab/.pyenv/versions/3.7.2/lib/python3.7/site-packages/psychopy/visual/window.py", line 950, in flip self.backend.swapBuffers(flipThisFrame) File "/home/danckertlab/.pyenv/versions/3.7.2/lib/python3.7/site-packages/psychopy/visual/backends/pygletbackend.py", line 276, in swapBuffers self.winHandle.dispatch_events() File "/home/danckertlab/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pyglet/window/xlib/__init__.py", line 855, in dispatch_events while xlib.XCheckWindowEvent(_x_display, _window, 0x1ffffff, byref(e)): ctypes.ArgumentError: argument 2: <class 'TypeError'>: wrong type

I have pyglet running on Mint and one issue I ran into was that it wanted to do something funny with my monitor. It looks like your win object is of the wrong type? When you instantiate win what does it look like? Here is mine:

win = visual.Window(fullscr=False, color='white', units='pix', size=[1200, 1000], allowGUI=None, winType='pyglet', gammaErrorPolicy='ignore')

Hi Cassandra, this is what I am using to create windows:


def create_window():
    # win = visual.Window(fullscr=True,color='white',units='norm')
    return visual.Window(color='white',units='norm')

This has been working for me so far but not on Linux Mint unfortunately. Any ideas?

I’m assuming you’re running this in a terminal. Could you do a pip freeze?

I use Linux Mint 19 too.
Maybe the reason is in pyglet. What is your version pyglet?
Psychopy does not works good with last version pyglet. Use pyglet==1.3.2