psychopy.org | Reference | Downloads | Github

Error Excel-file in PsychoPy 1.90

I have just installed PsychoPy’s newest version on my computer, but I run into an error when using a conditions file to loop over trials. When calling upon the Excel file, I get this error message:

Attribute error: ‘OrderedDict’ object has no attribute ‘Stim1Pos’

(Where ‘Stim1Pos’ is the name of the first variable in my Excel conditions file.)
When running PsychoPy on an older version, I do not encounter this problem. Could you tell me what I should change?

Please give the full text of the error message.

Hi @Annabel_Nijhof, I am looking at why you are getting this error but cannot recreate it based on this information. Would it be possible to upload you experiment and conditions file please?

1 Like

Hi Michael,
I have seen you mentioned in another topic that this appears to be a general bug in the newest PsychoPy-version? Sorry for not uploading the full error message before, in case it still helps, here it is:

Traceback (most recent call last):
File “C:\Users\k1772441\OneDrive - King’s College London\PsychoPyExps\NameAB\ContNameAB-b1-1.py”, line 561, in
exec(paramName + ‘= thisTrial.’ + paramName)
File “”, line 1, in
AttributeError: ‘OrderedDict’ object has no attribute ‘T1Pos’

(But basically I get the same error message for any of my experiments calling on an xlsx-file for the conditions…)

Hi Annabel, did you see David’s request above? We need to get a reproducible example to chase down this problem.

I have the same issue.

Traceback (most recent call last):
File “/Users/testingroom2/Desktop/EXPs/SL/scram/TL_mr_scram.py”, line 367, in
exec(paramName + ‘= thisBlockLoop.’ + paramName)
File “”, line 1, in
AttributeError: ‘OrderedDict’ object has no attribute ‘testblockA’

testblockA is the first column in my blockorder csv file

Hi,
I’m having a related problem. I recently updated to Pscyhopy 1.90 and now (using Builder) when, in a code component, I call a variable from a spreadsheet I get the same Attribute Error. Has the code for calling a variable from a spreadsheet in a code component changed?

This was the code
timeToAdd = thisMainLoop.times

(Loop name = mainLoop, the attached spreadsheet has a column labelled “times”). This was how it used to work but now I get the “AttributeError” message.

Anyone know what’s going on?
Thanks,
Mark

Hi @Mark_Scott, the error is saying that the code is referencing an attribute called “times” in thisMainLoop, which does not exist. You can access your key value pairs stored in your variable using square brackets, so try:

timeToAdd = thisMainLoop['times']

If this does not work, please post a minimum working example of your code.

1 Like

Hi,
That solved it - thanks! I assume this is a change caused by the switch to Python 3.
Thanks,
Mark