AttributeError: 'Picture' object has no attribute 'reposition'
Hello,
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
Traceback:
File "/usr/lib/python2.7/dist-packages/libqtopensesame/misc/process.py", line 154, in run
exp.run()
File "/usr/lib/python2.7/dist-packages/libopensesame/experiment.py", line 449, in run
self.items.execute(self.var.start)
File "/usr/lib/python2.7/dist-packages/libopensesame/item_store.py", line 103, in execute
self.run(name)
File "/usr/lib/python2.7/dist-packages/libopensesame/item_store.py", line 122, in run
self[name].run()
File "/usr/lib/python2.7/dist-packages/libopensesame/sequence.py", line 51, in run
self.experiment.items.run(_item)
File "/usr/lib/python2.7/dist-packages/libopensesame/item_store.py", line 122, in run
self[name].run()
File "/usr/lib/python2.7/dist-packages/libopensesame/loop.py", line 341, in run
self.experiment.items.execute(self._item)
File "/usr/lib/python2.7/dist-packages/libopensesame/item_store.py", line 102, in execute
self.prepare(name)
File "/usr/lib/python2.7/dist-packages/libopensesame/item_store.py", line 142, in prepare
self[name].prepare()
File "/usr/lib/python2.7/dist-packages/libopensesame/sequence.py", line 124, in prepare
self.experiment.items.prepare(_item)
File "/usr/lib/python2.7/dist-packages/libopensesame/item_store.py", line 142, in prepare
self[name].prepare()
File "/usr/lib/python2.7/dist-packages/libopensesame/sketchpad.py", line 146, in prepare
temp_name, element.element_name
File "/usr/lib/python2.7/dist-packages/openexp/_canvas/canvas.py", line 349, in __exit__
self.prepare()
File "/usr/lib/python2.7/dist-packages/openexp/_canvas/canvas.py", line 770, in prepare
element.prepare()
File "/usr/lib/python2.7/dist-packages/openexp/_canvas/_image/xpyriment.py", 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!
Comments
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
Hi Jan,
I suspect that you have an older version of
expyriment
installed. Could that be it?Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!