Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Issues when launching experiment from command line

edited November 2017 in OpenSesame

Dear all, thank you in advance for any help!

I solved this initial issue, but leaving the discussion open in case others run into the same problem.

I created an experiment which runs fine from the OpenSesame GUI, and now I'd like to launch it from the terminal using the code on this post. I get the error:
File "/anaconda/lib/python2.7/site-packages/openexp/_canvas/xpyriment.py", line 30, in
u'Failed to import expyriment, probably because it is not (correctly) installed. For installation instructions, please visit http://www.expyriment.org/.')
However, when I $ pip install expyriment[all]
Requirement already satisfied: expyriment[all] in /anaconda/lib/python2.7/site-packages

Notes:
Running on MacOS High Sierra, in case that is of any use. The end goal is to be able to dispense with the hand-loaded file pool, since we have 100 different conditions, each requiring a different set of wav files to be played. Thus, ideally, I'd run a script that selects from a condition that has not been ran, lists the wavs into a csv, and passes the participant number to the OpenSesame experiment, which relies on that newly created csv file list.

Comments

  • I also checked that the path to expyriment was in my system path:
    import sys
    print(sys.path)

    yields a list that includes: '/anaconda/lib/python2.7/site-packages',

    So then I launched expyriment directly, which revealed the real culprit: UTF-8 locale not recognized. The fix is here: https://coderwall.com/p/-k_93g/mac-os-x-valueerror-unknown-locale-utf-8-in-python

  • Although now the experiment starts to launch (e.g., a window appears ever so briefly), the error traceback doesn't allow me to know where the new issue is coming from:
    $ python launchExp.py 0
    Expyriment 0.9.0 (Python 2.7.13)
    Main file: launchExp.py (3763a5)
    launchExp.py
    Traceback (most recent call last):
    File "launchExp.py", line 10, in
    exp.run()
    File "/anaconda/lib/python2.7/site-packages/libopensesame/experiment.py", line 397, in run
    self.init_display()
    File "/anaconda/lib/python2.7/site-packages/libopensesame/experiment.py", line 664, in init_display
    canvas.init_display(self)
    File "/anaconda/lib/python2.7/site-packages/openexp/canvas.py", line 65, in init_display
    cls.init_display(experiment)
    File "/anaconda/lib/python2.7/site-packages/openexp/_canvas/xpyriment.py", line 274, in init_display
    exp = control.initialize()
    File "/anaconda/lib/python2.7/site-packages/expyriment/control/_experiment_control.py", line 454, in initialize
    position=(0, -5))
    File "/anaconda/lib/python2.7/site-packages/expyriment/stimuli/_textline.py", line 102, in init
    raise IOError("Font '{0}' not found!".format(text_font))
    IOError: Font 'None' not found!
    Error in atexit._run_exitfuncs:
    Traceback (most recent call last):
    File "/anaconda/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
    File "/anaconda/lib/python2.7/site-packages/sounddevice.py", line 2646, in _exit_handler
    assert _initialized >= 0
    AssertionError
    Error in sys.exitfunc:
    Traceback (most recent call last):
    File "/anaconda/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
    File "/anaconda/lib/python2.7/site-packages/sounddevice.py", line 2646, in _exit_handler
    assert _initialized >= 0
    AssertionError

    Some of it appears to relate to fonts, but I can clearly see in the .osexp file that font HAS been specified:
    set font_underline no
    set font_size 26
    set font_italic no
    set font_family sans
    set font_bold no

Sign In or Register to comment.