# Please Help with AL lib: (EE) alc\_cleanup: 1 device not closed and Stroop test

**URL:** <https://discourse.psychopy.org/t/please-help-with-al-lib-ee-alc-cleanup-1-device-not-closed-and-stroop-test/2089>\
**Category:** Builder\
**Tags:** syntaxerror\
**Created:** [March 9, 2017, 1:44am UTC](https://discourse.psychopy.org/t/please-help-with-al-lib-ee-alc-cleanup-1-device-not-closed-and-stroop-test/2089 "2017-03-09T01:44:49Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![awai](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@awai](https://discourse.psychopy.org/u/awai)\
**Post date:** [March 9, 2017, 1:44am UTC](https://discourse.psychopy.org/t/please-help-with-al-lib-ee-alc-cleanup-1-device-not-closed-and-stroop-test/2089/1 "2017-03-09T01:44:49Z")

</div>

I followed this youtube tutorial by Jon to build a stroop test ([https://www.youtube.com/watch?v=VV6qhuQgsiI](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:

##### Running: /home/alice/Documents/PyschoPyExperiments/stroop\_lastrun.py

/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

I followed the tasks to comment out specific lines from this forum: [https://groups.google.com/forum/#!msg/psychopy-users/sxJtzJTc2Ww/tPXu062z-7QJ](https://groups.google.com/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!

---

<div class="post-metadata">

**Author:** ![Michael](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/michael/32/16_2.png) [@Michael](https://discourse.psychopy.org/u/Michael)\
**Post date:** [March 9, 2017, 9:30pm UTC](https://discourse.psychopy.org/t/please-help-with-al-lib-ee-alc-cleanup-1-device-not-closed-and-stroop-test/2089/2 "2017-03-09T21:30:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![awai](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@awai](https://discourse.psychopy.org/u/awai)\
**Post date:** [March 10, 2017, 8:38pm UTC](https://discourse.psychopy.org/t/please-help-with-al-lib-ee-alc-cleanup-1-device-not-closed-and-stroop-test/2089/4 "2017-03-10T20:38:16Z")

</div>

Hi Michael,

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

[stroop.psyexp](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/2X/c/c1647511c11f4044521ab0ed3684da2ec919a056.psyexp) (9 KB)

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

[stroopConditions.xlsx](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/2X/a/a5e2d461c2484f48fb4f31c828cc43cedd5b310c.xlsx) (4.8 KB)

---

<div class="post-metadata">

**Author:** ![Michael](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/michael/32/16_2.png) [@Michael](https://discourse.psychopy.org/u/Michael)\
**Post date:** [March 11, 2017, 11:23pm UTC](https://discourse.psychopy.org/t/please-help-with-al-lib-ee-alc-cleanup-1-device-not-closed-and-stroop-test/2089/5 "2017-03-11T23:23:42Z")

</div>

Hello,

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

---

<div class="post-metadata">

**Author:** ![awai](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@awai](https://discourse.psychopy.org/u/awai)\
**Post date:** [March 13, 2017, 6:48am UTC](https://discourse.psychopy.org/t/please-help-with-al-lib-ee-alc-cleanup-1-device-not-closed-and-stroop-test/2089/6 "2017-03-13T06:48:45Z")

</div>

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?

Thanks!

---

<div class="post-metadata">

**Author:** ![Michael](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/michael/32/16_2.png) [@Michael](https://discourse.psychopy.org/u/Michael)\
**Post date:** [March 13, 2017, 7:32am UTC](https://discourse.psychopy.org/t/please-help-with-al-lib-ee-alc-cleanup-1-device-not-closed-and-stroop-test/2089/7 "2017-03-13T07:32:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![awai](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@awai](https://discourse.psychopy.org/u/awai)\
**Post date:** [March 14, 2017, 5:16pm UTC](https://discourse.psychopy.org/t/please-help-with-al-lib-ee-alc-cleanup-1-device-not-closed-and-stroop-test/2089/8 "2017-03-14T17:16:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![daniel.riggs1](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/daniel.riggs1/32/8103_2.png) [@daniel.riggs1](https://discourse.psychopy.org/u/daniel.riggs1)\
**Post date:** [March 15, 2017, 6:31pm UTC](https://discourse.psychopy.org/t/please-help-with-al-lib-ee-alc-cleanup-1-device-not-closed-and-stroop-test/2089/9 "2017-03-15T18:31:28Z")

</div>

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](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/2X/3/393a56ec086a87b1230ae18d2e371ffafbf48848.xlsx) (4.8 KB)

---

<div class="post-metadata">

**Author:** ![tomstafford](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/tomstafford/32/1639_2.png) [@tomstafford](https://discourse.psychopy.org/u/tomstafford)\
**Post date:** [October 11, 2017, 5:45am UTC](https://discourse.psychopy.org/t/please-help-with-al-lib-ee-alc-cleanup-1-device-not-closed-and-stroop-test/2089/10 "2017-10-11T05:45:59Z")

</div>

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

(here is the clue: [https://groups.google.com/forum/#!topic/gensim/ilMexTuCt9A](https://groups.google.com/forum/#!topic/gensim/ilMexTuCt9A))

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

`sudo pip install numpy==1.10.0`
