Experiment file from builder missing lines of code

OS (e.g. Win10): MacOS Sonoma, Version 14.5
PsychoPy version (e.g. 2024.2.4 Py 3.8): 2024.2.4 Py 3.10
Standard Standalone Installation? (y/n) If not then what?: y
Do you want it to also run online? (y/n): eventually, yes. currently just on desktop.

What are you trying to achieve?:
I am new to PsychoPy and am trying to build an experiment that will present simple images and text in a loop. I want to pull these images & text from a csv file where the filepaths are stored for each trial loop, however I’ve been running into an issue where I will get an error like this:

“Study/experiment_testing/exp.py”, line 382, in run
text=text,
NameError: name ‘text’ is not defined. Did you mean: ‘next’? "

When I looked into the python file (and compared with templates), I found that the component was not getting initialized correctly and that component parameters for each repeat in a loop was not getting updated. As in, those lines of code were not present. I added the missing lines in, and when I went to pilot the experiment from the python file, it ran as expected. However, when I then go to run the experiment from the builder, the code reverts back to its initial state (where these lines of code were not present) and flags the error again.

Has anyone run into a similar issue? I’ve tried deleting and reinstalling PsychoPy again and making sure that I’m using a correct python version, but this hasn’t worked for me. Ideally I would like to continue using the builder, but this issue is making it essentially unusable for me. Any comments would be much appreciated! Thanks!

Hello

It is most likley a typo. Python is case-sensitive. Also, column names and routine names should differ, AFAIK.

Builder is a one-way street. It creates Python-code but ignores any changes you make to the Python-code.

Did you leave it at constant by accident?

Best wishes Jens

1 Like