Howdy, Stranger!

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

Supported by

AttributeError: 'Picture' object has no attribute 'reposition'


I added a series of jpg files (called 1.jpg through 327.jpg) to the file pool and used some inline scripts to determine which jpg files should be displayed during a trial. [my_literal] is a number between 1 and 327 set using an inline script. To display the corresponding picture, I tried using the following sketchpad script:

set duration keypress
set description "Displays stimuli"
draw image center=1 file="[my_literal].jpg" scale=1 show_if=always x=0 y=0 z_index=0
draw textline center=1 color=white font_bold=no font_family=mono font_italic=no font_size=18 html=yes show_if=always text="[my_literal]" x=0 y=96 z_index=0

When I run the experiment, I get the following error message; Googling it didn't return anything useful:

Unexpected error

item-stack: experiment[run].AdaptationBlock1[run].AdaptationBlock1Sequence[prepare].PicturePresentation[prepare]
exception type: AttributeError
exception message: 'Picture' object has no attribute 'reposition'
time: Tue Jun 12 11:26:52 2018

  File "/usr/lib/python2.7/dist-packages/libqtopensesame/misc/", line 154, in run
  File "/usr/lib/python2.7/dist-packages/libopensesame/", line 449, in run
  File "/usr/lib/python2.7/dist-packages/libopensesame/", line 103, in execute
  File "/usr/lib/python2.7/dist-packages/libopensesame/", line 122, in run
  File "/usr/lib/python2.7/dist-packages/libopensesame/", line 51, in run
  File "/usr/lib/python2.7/dist-packages/libopensesame/", line 122, in run
  File "/usr/lib/python2.7/dist-packages/libopensesame/", line 341, in run
  File "/usr/lib/python2.7/dist-packages/libopensesame/", line 102, in execute
  File "/usr/lib/python2.7/dist-packages/libopensesame/", line 142, in prepare
  File "/usr/lib/python2.7/dist-packages/libopensesame/", line 124, in prepare
  File "/usr/lib/python2.7/dist-packages/libopensesame/", line 142, in prepare
  File "/usr/lib/python2.7/dist-packages/libopensesame/", line 146, in prepare
    temp_name, element.element_name
  File "/usr/lib/python2.7/dist-packages/openexp/_canvas/", line 349, in __exit__
  File "/usr/lib/python2.7/dist-packages/openexp/_canvas/", line 770, in prepare
  File "/usr/lib/python2.7/dist-packages/openexp/_canvas/_image/", line 49, in prepare
    self._stim.reposition((x, y))
AttributeError: 'Picture' object has no attribute 'reposition'

Incidentally, the textline only serves debugging purposes: If I remove the "draw image" line, the experiment runs find and the "draw textline" line confirms that [my_literal] produces a number between 1 and 327.

If I just use "1.jpg" etc., instead of "[my_literal].jpg", the experiment runs fine, too, but that wouldn't solve my problem.

Any ideas? Thanks!


  • I'm sorry - I just found out that I receive the same error when I use "1.jpg" now.

  • Aha! I changed the Back-end in the experiment file from xpyriment to legacy, and now it works :)

  • edited June 2018

    Hi Jan,

    I suspect that you have an older version of expyriment installed. Could that be it?


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

Sign In or Register to comment.