| Reference | Downloads | Github

Good & bad experience with Linux + Psychopy1.90.0 + Python3.6

Short story, good news:
After some change (see long story below) psychoPy 1.90.0 works on Python 3.6 on Linux.

Short story, bad news:
Still, second screen cannot be used.

Long story, in the hope somebody can save time:

A) out of the box & pip install psychopy
All dependent packages will be fetched via pip, but errors occured:

  • In /tmp almost 3GB(!) were used (“no space left”, had to enlarge that, hope that helps others)
  • some more errors, long list, gave up that way.

B) all packages in environment via conda install (from info before)
then again pip install psychopy
install seems ok
but crashes immediately with seg-fault
gave up that way, too

C) download tar-ball from github
create new miniconda environment with the provided conda/environment-3.6.yml
=> ok
locally executed pip install .
=> ok

ImportError: cannot open shared object file: No such file or directory

Yes, Debian Stretch uses libpng16; so additionally installed 12 from Jessie
=> ok

Yes, psychopyApp starts
but loading Demos/timebyframes and starting gives

ModuleNotFoundError: No module named 'PyQt4'
(Yes, my System has Qt4 and Qt5 as shown by qtchooser -l)
Change sourcecode to matplotlib.use('Qt5Agg')

Yes, psychopyApp starts
and timing is very accurate! Great. Thanks!

Remaining Issue:
I need to run on the second (faster) screen, so changed screen=1 in timebyframes
win = visual.Window([1280, 1024], fullscr=True, screen=1, allowGUI=False, waitBlanking=True)

but no success, window still opens on 1st screen and program complains

0.7966 WARNING Requested an unavailable screen number - using first available.

If somebody could give me a hint, please, how to improve that?

Thanks a lot!

(edited layout and spelling mistakes)

Thanks for info.

A) seems like a pip problem (nothing to do with us) but I wonder why that isn’t affecting many people using pip for everything on linux :-/
B) no idea what that is

libpng: I wonder which package is needing/not-finding libpng. (It sure isn’t psychopy code itself that fails, so some dependent package needs fixing but which one?) Better if you could provide full error stack not just last line

pyqt: (this one I know to be about matplotlib, but it would have been better to give the full error, not just hte last line) This is a tricky one. Different systems have different best default backends for mpl, but good point that qt4 is not good for Py3

dual monitor: Might be a problem for pyglet on linux. Could you see what happens if you do:

win = visual.Window([1280, 1024], fullscr=True, screen=1, allowGUI=False, waitBlanking=True, winType='glfw')

GLFW backend is a new thing that @mdc has been developing and might have better dual-screen support?

Hi Jon, thanks a lot for your answer!

Sorry, the full Error messages are:

Traceback (most recent call last):
File “/home/wannek/miniconda3/envs/anaconda-py3/bin/”, line 96, in
File “/home/wannek/miniconda3/envs/anaconda-py3/bin/”, line 22, in start_app
from import PsychoPyApp
File “/home/wannek/miniconda3/envs/anaconda-py3/lib/python3.6/site-packages/psychopy/app/”, line 26, in
import wx
File “/home/wannek/miniconda3/envs/anaconda-py3/lib/python3.6/site-packages/wx/”, line 17, in
from wx.core import *
File “/home/wannek/miniconda3/envs/anaconda-py3/lib/python3.6/site-packages/wx/”, line 12, in
from ._core import *
ImportError: cannot open shared object file: No such file or directory


############ Running: /home/wannek/Code/psychopy190/ ############

with 22: matplotlib.use(‘Qt4Agg’)

Traceback (most recent call last):
File “/home/wannek/Code/psychopy190/”, line 24, in
import pylab
File “/home/wannek/miniconda3/envs/anaconda-py3/lib/python3.6/site-packages/”, line 1, in
from matplotlib.pylab import *
File “/home/wannek/miniconda3/envs/anaconda-py3/lib/python3.6/site-packages/matplotlib/”, line 252, in
from matplotlib import cbook, mlab, pyplot as plt
File “/home/wannek/miniconda3/envs/anaconda-py3/lib/python3.6/site-packages/matplotlib/”, line 115, in
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File “/home/wannek/miniconda3/envs/anaconda-py3/lib/python3.6/site-packages/matplotlib/backends/”, line 62, in pylab_setup
[backend_name], 0)
File “/home/wannek/miniconda3/envs/anaconda-py3/lib/python3.6/site-packages/matplotlib/backends/”, line 9, in
from .backend_qt5agg import (
File “/home/wannek/miniconda3/envs/anaconda-py3/lib/python3.6/site-packages/matplotlib/backends/”, line 15, in
from .backend_qt5 import (
File “/home/wannek/miniconda3/envs/anaconda-py3/lib/python3.6/site-packages/matplotlib/backends/”, line 19, in
import matplotlib.backends.qt_editor.figureoptions as figureoptions
File “/home/wannek/miniconda3/envs/anaconda-py3/lib/python3.6/site-packages/matplotlib/backends/qt_editor/”, line 20, in
import matplotlib.backends.qt_editor.formlayout as formlayout
File “/home/wannek/miniconda3/envs/anaconda-py3/lib/python3.6/site-packages/matplotlib/backends/qt_editor/”, line 54, in
from matplotlib.backends.qt_compat import QtGui, QtWidgets, QtCore
File “/home/wannek/miniconda3/envs/anaconda-py3/lib/python3.6/site-packages/matplotlib/backends/”, line 153, in
from PyQt4 import QtCore, QtGui
ModuleNotFoundError: No module named ‘PyQt4’

And thanks for the hint for glfw

apt-get install libglfw3
pip install glfw (Successfully installed glfw-1.5.1)


############ Running: /home/wannek/Code/psychopy190/ ############

with 26: win = visual.Window([1280, 1024], fullscr=True, screen=1, allowGUI=False, waitBlanking=True, winType=‘glfw’)

Traceback (most recent call last):
File “/home/wannek/Code/psychopy190/”, line 28, in
win = visual.Window([1280, 1024], fullscr=True, screen=1, allowGUI=False, waitBlanking=True, winType=‘glfw’)
File “/home/wannek/miniconda3/envs/anaconda-py3/lib/python3.6/site-packages/psychopy/visual/”, line 375, in init
self.backend = backends.getBackend(win=self, *args, **kwargs)
File “/home/wannek/miniconda3/envs/anaconda-py3/lib/python3.6/site-packages/psychopy/visual/backends/”, line 25, in getBackend
from .glfwbackend import GLFWBackend as Backend
File “/home/wannek/miniconda3/envs/anaconda-py3/lib/python3.6/site-packages/psychopy/visual/backends/”, line 48, in
WINDOW_ICON =‘psychopy/monitors/psychopy.ico’)
File “/home/wannek/miniconda3/envs/anaconda-py3/lib/python3.6/site-packages/PIL/”, line 2543, in open
fp =, “rb”)
FileNotFoundError: [Errno 2] No such file or directory: ‘psychopy/monitors/psychopy.ico’
Exception ignored in: <bound method Window.del of <psychopy.visual.window.Window object at 0x7ff13fccd908>>
(and a close error because None before)

But file(s) exist:

find . -name psychopy.ico

Thanks a lot for helping!

The icon problem seems like an easy fix. It worked fine on my Windows and Linux systems, however I was using PyCharm which might have setup the appropriate paths. I’ll issue a correction in the next point release.

Hi mdc,
thanks for your answer! What do you suggest as a proper path workaround in the mean time? Hard coding version-related paths is not really nice.

You might need to do that as I haven’t fully investigated the issues.

Ok, made path relative
_WINDOW_ICON_ ='../../../monitors/psychopy.ico')

Result: Window opens. Fullscreen ok, timing ok, looks good!.

But still always only on Screen0, same Warning message, if tried with Screen=1.

Side effect: if provided with “wrong” resolution, but fullscreen=True, then canvas behaves like a window (an always-on-top windows stays on top) and resolution is zoomed. And timing is ugly, tearing visible.


The results with the wrong resolution is intentional as the GLFW backend supports forcing the display into specific video modes needed for some planned features. However it should put itself into a default mode if the resolution specified is not a supported video mode.

Are you using a “spanned” desktop, where the driver treats both monitors as a single display? A solution would be to create a window with “allowGUI=False”, set its size to the dimensions of your display, and set the position of the window to the top corner of your second display on the virtual screen.

Hi mdc, thanks a lot for helping!

Yes,the intention is nice - and works.
What I wondered about is the other window staying on top (does that mean, the stimulus content is rendered through the system, not directly, and thus slower?)

Spanned? No, I have two independent “zaphodheads”, because my intention is to drive the 2nd (stimulus) monitor at it’s 120Hz - with really accurate frame-by-frame timing. Even now, on the “wrong” and slow (control) monitor, I observe strong tearing, which isn’t visible if just one screen is used.

Each display using its own X server might be the issue here. I’m not sure Pyglet or the GLFW bindings as-is have a good way of dealing with that. I’ll look into it further, it may require a more complex solution.

For the icon, I would suggest:

from psychopy import prefs
from os import path

    path.join(prefs.paths['resources'], 'psychopy.ico')

Or maybe use the png file, which is also in the resources folder?

Looks good, I’ll patch it.

GLFW on multiple monitors
Before, I used different X-screens. Now I tried a single desktop on a single X-screen across the two monitors.

good news:

  • refresh rate on fast stimulus monitor is recognized as 120fps
  • on control monitor 60fps

bad news:

  • timing is worse compared to single setup
  • more “noise” in timing histogram
  • dropouts (few ~ 1%)
  • tearing visible

strange (as observed before, different thread from Sept./Okt. last year)

  • Stimulus window always opens on same screen as the App is started from, independent of setting Screen=0 or Screen=1
  • If Screen=x is same as started, behaviour is normal
  • If Screen=y is the opposite, this other monitor shortly goes black and resumes
    • but eventually with a different refresh rate during program runs
    • and resumes after closing of output window to its previous state

Does this mean, pyglet(?) tries to start on intended monitor but somehow fails, falling back to same as App?
No error messages related to that.
Always fullscreen with correct resolution.

@uliw, @jon: Concerning B), the Segmentation fault in the pip install, I have the same and raised a GitHub issue here. I also reported how to make it work using pip3 install! +1 for the python3 version!