I followed this youtube tutorial by Jon to build a stroop test (https://www.youtube.com/watch?v=VV6qhuQgsiI) but I have these errors when I run the experiment. When I run I can see the instructions page successfully but after I click on any key, the trial does not run and I see the following errors:
/usr/lib/python2.7/dist-packages/openpyxl/worksheet/worksheet.py:374: UserWarning: Call to deprecated function or class get_highest_column (Use the max_column propery.).
def get_highest_column(self):
/usr/lib/python2.7/dist-packages/openpyxl/worksheet/worksheet.py:347: UserWarning: Call to deprecated function or class get_highest_row (Use the max_row property).
def get_highest_row(self):
Traceback (most recent call last):
File “/home/alice/Documents/PyschoPyExperiments/stroop_lastrun.py”, line 165, in
for thisTrial in trials:
File “/usr/lib/python2.7/dist-packages/psychopy/data.py”, line 951, in next
self.data.add(‘ran’,1)
File “/usr/lib/python2.7/dist-packages/psychopy/data.py”, line 3618, in add
self[thisType][position[0],position[1]]=value
File “/usr/local/lib/python2.7/dist-packages/numpy/ma/core.py”, line 3301, in setitem
_data[indx] = dval
IndexError: only integers, slices (:), ellipsis (...), numpy.newaxis (None) and integer or boolean arrays are valid indices
AL lib: (EE) alc_cleanup: 1 device not closed
The keys in the instruction screen (‘a’, ‘s’ or ‘d’) don’t match the keys allowed in the keyboard component (‘left’,‘right’,‘down’). You need to change either of these so they match each other, otherwise responses won’t be accepted and the trial won’t move on.
Your conditions file contains one cell where the colour is actually 'red ’ rather than ‘red’. This causes an error, as PsyxhoPy can’t recognise 'red ’ as a colour name. It is really hard to pick up extraneous spaces in Excel, which is why it can be worth exporting to the simpler .csv format, which, being text based, can be opened in a text editor which shows invisible characters like spaces and tabs.
Thanks for catching the issues. I was testing between (‘a’, ‘s’ or ‘d’) and the (‘left’,‘right’,‘down’) since my ‘right’ key does not alway work, thanks for the consistency check and for noting the 'red ’ cell issue. I made the corresponding changes and tried looking for other errors but could not find anymore. But I still see the same error messages in all the same lines.
The error seems to be coming from the openpyxl library, which is responsible for reading Excel files. I’d suggest exporting your conditions file to .csv format and use that instead.
The error in your title is a message that comes from a non-python process, I’m also on Ubuntu and I would get those messages, and they would never affect anything, so they real error seems like it was cut off in your message.
Regardless, I think @Michael is right in that it’s just a bad conditions file. Excel format can create some inivisible problems, since its internal structure is much more complicated than a simple .csv (text) file, so something like having a space character in a far off column or row could screw the pooch.
Since this conditions file was small enough, I just hand copied to a new one and everything worked fine.