Sign in with your CogSci, Facebook, Google, or Twitter account.

Or register to create a new account.

We'll use your information only for signing in to this forum.

Supported by

PsychoPy backend causes OpenSesame Hang-up

imnotamemberimnotamember Posts: 12
edited March 20 in OpenSesame

Hi all,
I recently had to reformat my Kubuntu system and reinstalled OpenSesame. It worked previously without issue using PsychoPy backend. Now with a fresh system install and new install of OpenSesame I cannot run an experiment using the PsychoPy backend.

For clarification, when I hit any of the run buttons (windowed, fullscreen, quickrun) OpenSesame grays out fields as normal when an experiment begins. But that is as far as it gets. Here is the output from the run (including the output following me killing the experiment process to return control to the main OpenSesame window).

Python 2.7.12

* Type "help()", "copyright()", "credits()" or "license()" for more information.
* Use the "print([msg])" function in inline_script items to print to this debug window.
* Inspect inline_script variables when an experiment is finished.

In [1]: Starting experiment as ExperimentProcess-3
openexp._canvas.psycho.init_display(): waitblanking = True
openexp._canvas.psycho.init_display(): monitor = testMonitor
openexp._canvas.psycho.init_display(): screen = 0

Python seems to have crashed. This should not happen. If Python crashes often, please report it on the OpenSesame forum.

time: Mon Mar 20 15:37:25 2017

No window/full-screen comes on showing the stimuli. I've reinstalled various times with different versions of PsychoPy installed seperately and nothing changes this result. This is also just the initial 'welcome' experiment that OpenSesame defaults to when starting.

Thought I'd bring this up in case it is a new bug (I didn't see references to this anywhere on the forums or the rest of the internet).

Here is my system info list from within OpenSesame:


System: Linux-4.4.0-66-generic-x86_64-with-Ubuntu-16.04-xenial
Architecture: 64bit
Modules and packages

OpenSesame 3.1.6
Python 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]
QProgEdit 4.0.9
datamatrix 0.4.4
qdatamatrix 0.1.13
pseudorandom 0.2.2
fileinspector 1.0.2
QNotifications 1.1.1
QOpenScienceFramework [not available]
expyriment [not available]
IPython 2.4.1
numpy 1.11.0
scipy 0.17.0
psychopy 1.83.04
pygame 1.9.1release
pygaze 0.6.0a21
pyglet 1.1.4
PyQt 5.5.1
serial 3.0.1
markdown 2.6.6
bidi [not available]
yaml 3.11


  • sebastiaansebastiaan Posts: 2,516


    I would first check if PsychoPy works by itself (not from within OpenSesame), for example by running this example script:

    from psychopy import visual, core  # import some libraries from PsychoPy
    #create a window
    mywin = visual.Window([800,600], monitor="testMonitor", units="deg")
    #create some stimuli
    grating = visual.GratingStim(win=mywin, mask="circle", size=3, pos=[-4,0], sf=3)
    fixation = visual.GratingStim(win=mywin, size=0.5, pos=[0,0], sf=0, rgb=-1)
    #draw the stimuli and update the window
    #pause, so you get a chance to see it!

    This should show a simple grating and fixation square for 5 s. Does that work?


    Thanked by 1imnotamember

    There's much bigger issues in the world, I know. But I first have to take care of the world I know.

  • Hi Sebastiaan,

    Thanks for the help! I ran your testing code both in the PsychoPy Coder and in a terminal within my python environment, and it works in both.

    As a side note, when I run this:

    API: 2
    OpenSesame: 3.1.6
    Platform: posix
    set width 1024
    set uniform_coordinates yes
    set title "New experiment"
    set subject_parity even
    set subject_nr 0
    set start experiment
    set sound_sample_size -16
    set sound_freq 48000
    set sound_channels 2
    set sound_buf_size 1024
    set sampler_backend legacy
    set round_decimals 2
    set mouse_backend psycho
    set keyboard_backend psycho
    set height 768
    set fullscreen no
    set form_clicks no
    set foreground white
    set font_underline no
    set font_size 18
    set font_italic no
    set font_family mono
    set font_bold no
    set disable_garbage_collection yes
    set description "The main experiment item"
    set coordinates uniform
    set compensation 0
    set color_backend psycho
    set clock_backend psycho
    set canvas_backend psycho
    set bidi no
    set background black
    define sequence experiment
        set flush_keyboard yes
        set description "Runs a number of items in sequence"
        run new_inline_script always
    define inline_script new_inline_script
        set description "Executes Python code"
        set _run "print 'testing in run phase'"
        set _prepare "print 'testing in prepare phase'"

    My output is:

    Python 2.7.12
    * Type "help()", "copyright()", "credits()" or "license()" for more information.
    * Use the "print([msg])" function in inline_script items to print to this debug window.
    * Inspect inline_script variables when an experiment is finished.
    In [1]: Starting experiment as ExperimentProcess-2

    Which makes me think the error is occurring very early in the set-up (usually it at least indicates some packages were loaded after the 'Starting experiment...' line).

    I just tried the same code by running OpenSesame in terminal with the debug and warning flags on and got this message numerous times, but I assume it isn't necessarily related since it's just a warning(?).

      File "/usr/bin/opensesame", line 25, in <module>
      File "/usr/lib/python2.7/dist-packages/libqtopensesame/__main__.py", line 87, in opensesame
      File "/usr/lib/python2.7/dist-packages/libqtopensesame/qtopensesame.py", line 1007, in run_quick
        self.run_experiment(fullscreen=False, quick=True)
      File "/usr/lib/python2.7/dist-packages/libqtopensesame/qtopensesame.py", line 973, in run_experiment
      File "/usr/lib/python2.7/dist-packages/libqtopensesame/runners/base_runner.py", line 256, in run
        ret_val = self.execute()
      File "/usr/lib/python2.7/dist-packages/libqtopensesame/runners/multiprocess_runner.py", line 58, in execute
      File "/usr/lib/python2.7/multiprocessing/process.py", line 130, in start
        self._popen = Popen(self)
      File "/usr/lib/python2.7/multiprocessing/forking.py", line 126, in __init__
        code = process_obj._bootstrap()
      File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
      File "/usr/lib/python2.7/dist-packages/libqtopensesame/misc/process.py", line 128, in run
        subject_nr=self.subject_nr, logfile=self.logfile)
      File "/usr/lib/python2.7/dist-packages/libopensesame/experiment.py", line 140, in __init__
        item.item.__init__(self, name, self, string)
      File "/usr/lib/python2.7/dist-packages/libopensesame/item.py", line 67, in __init__
      File "/usr/lib/python2.7/dist-packages/libopensesame/experiment.py", line 345, in from_string
        self.items.new(item_type, item_name, def_str)
      File "/usr/lib/python2.7/dist-packages/libopensesame/item_store.py", line 156, in new
        name = self.valid_name(_type, suggestion=name)
      File "/usr/lib/python2.7/dist-packages/libopensesame/item_store.py", line 215, in valid_name
        while _name in self:
      File "/usr/lib/python2.7/dist-packages/libopensesame/item_store.py", line 290, in __contains__
        name = cistr(name)
      File "/usr/lib/python2.7/dist-packages/libopensesame/cistr.py", line 39, in __init__
        str.__init__(self, s)
      File "/usr/lib/python2.7/dist-packages/libqtopensesame/qtopensesame.py", line 343, in warn_with_traceback
    /usr/lib/python2.7/dist-packages/libopensesame/cistr.py:39: DeprecationWarning: object.__init__() takes no parameters
      str.__init__(self, s)

    Any help you can offer is greatly appreciated. I usually try to troubleshoot these things on my own but this is getting deeper into the OpenSesame core than I know at the moment. I thought you might have seen this in the past.


Sign In or Register to comment.