| Reference | Downloads | Github

Please Help with AL lib: (EE) alc_cleanup: 1 device not closed and Stroop test

I followed this youtube tutorial by Jon to build a stroop test ( 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:

Running: /home/alice/Documents/PyschoPyExperiments/

/usr/lib/python2.7/dist-packages/openpyxl/worksheet/ 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/ 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/”, line 165, in
for thisTrial in trials:
File “/usr/lib/python2.7/dist-packages/psychopy/”, line 951, in next‘ran’,1)
File “/usr/lib/python2.7/dist-packages/psychopy/”, line 3618, in add
File “/usr/local/lib/python2.7/dist-packages/numpy/ma/”, 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

I followed the tasks to comment out specific lines from this forum:!msg/psychopy-users/sxJtzJTc2Ww/tPXu062z-7QJ
and tried searching online for more solutions but there has been no success. I am also not using anything from the audio library either.

I am new to PsychoPy and do not know how to fix this. I am on Ubuntu 16.04 system.

Any help would be greatly appreciated! Thanks!

This seems odd in that there doesn’t seem to be anything wrong with the offending line in your actual experiment: for thisTrial in trials:

We probably need to see your Builder (i.e. .psyexp) file.

Hi Michael,

Thanks for looking into this! I have attached the .psyexp file.

stroop.psyexp (9 KB)

The .xlsx file for reading data looks fine as well. I have attached it just in case.

stroopConditions.xlsx (4.8 KB)


  • 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.

Otherwise, your experiment has been created fine.

Hi Michael,

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.

Would you have any other suggestions?


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.

Thanks I tried that as well but the same errors. I might need to try reinstalling it or avoid using data files.

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.

stroopConditions.xlsx (4.8 KB)

For me (PsychoPy 1.83 on Ubuntu 16.04) this was due to a numpy update

(here is the clue:!topic/gensim/ilMexTuCt9A)

I fixed by downgrading my version of numpy, and everything ran

sudo pip install numpy==1.10.0