Error in variable names

I have my experiment saved next to my Excel sheet in the same folder on my desktop. When I try to run it, I get the Name error “Name ‘cue’ is not defined”. Below is a screenshot of my excel sheet and the error that appears. Please let me know where I am going wrong. Thank you so much!!

Dear daisyjane1008

do you mind to share either your repository or a toy-version of your experiment (*.psyexp, *.xlsx, some *.jpg). PsychoPy tells you that the variable cue is not defined. Where and how in your experiment do you refer to cue?

BTW, it often better to store an experiment in a hard-drive folder instead of having it in a folder on the desktop (also both are on a hardware technically speaking).

Best wishes Jens

Hi Jens,

Thank you so much for your help. Above I had attached a screenshot of my excel file in which the variable “cue” is defined by a large group of images. Attached below is also the image file I had uploaded within PsychoPy in which I address this “cue” variable as $cue so that it will change to a different image for each trial. I have accurately defined it within my conditions Excel file as well as within the PsychoPy builder view. Please let me know what you think!

Dear Daisyjane

that looks ok. Did you check your Excel-file for trailing spaces in the column name cue?

Best wishes Jens

Yes, I have checked for trailing spaces or any smaller errors within the column and there doesn’t seem to be any. Should I be referring to the conditions.xlsx file in some other way before calling variables from it?

Hello,

do you mind giving access to your repository or upload your *.psyexp and *.xlsx-file along with some images, so that somebody else could test-run your experiment?

Best wishes Jens

Hi Jens,

I haven’t made much progress on the actual PsychoPy experiment but attached below is the conditions file as well as the psychopy file. Thank you so much for your help!

Best,
Jane

conditions.xlsx (84.2 KB) thesis.psyexp (7.5 KB)

Hello,

could you please upload image 012.jpg, 00120.jpg and 00121.jpg? Notice, all columns should be filled with values which isn’t the case for column G to U. Are these practice trials? You could save those in an extra Excel-file.

Best wishes Jens

Hi Jens,

Yes, those are the practice trials. Attached below are the images.

Hello daisyjane

ok, the toy-experiment runs for me. I noticed that you scale your cuefile and your searchfile to a square. However, the cue and the two examples are 666 x 500 pixel large. So, you will distort the pictures. Furthermore, the file-extension were jpeg instead of jpg as specified in your Excel-file. Change all filename-extensions such that extension and reference match. Last but not least, I noticed that there is no loop in the screen-shot you presented above. You need to add a loop to your trials, otherwise PsychoPy does not know of your variables.

grafik

Use your Excelfile in the trials Property field Conditions.

grafik

Best wishes Jens