psychopy.org | Reference | Downloads | Github

Routine goes away from Flow when PsychoPy restarted

If this template helps then use it. If not then just delete and start from scratch.

OS (e.g. Win10): Windows 10
PsychoPy version (e.g. 1.84.x): 1.90.2
Standard Standalone? (y/n) Yes

I added a new instruction Routine in the Flow, but the routine goes away from the Flow when PsychoPy is closed and run again. The Routine still is available in the builder window, but PsychoPy asks to add it again to the Flow.

The following message appears in the black Python.exe window.

“4.2010 ERROR A Routine called ‘b_instr_2_’ was on the Flow but could not be found (failed rename?). You may need to re-insert it”

What is your routine named?

I probably named it “instr_2” at the beginning, but it got renamed as [ b_‘instr_2’ ], exactly as between the bracket with the single quotes, when PsychoPy restarted. Tried renaming it, doesn’t work!

OK, it sounds like your .psyexp file has become corrupted. Never fear, it is just a plain text file structured as XML. So you can make a copy of the file and open it in a text editor (ideally one that will color code XML syntax). You can then search through and find the entry for the mis-named routine in the flow section and delete it. Save, and see if Builder can make sense of the edited file. Rinse and repeat if required to get it to work. NB the bit about only editing a copy: it’s easy for this sort of manual editing to go wrong.

Although first you might want to try reading the error message more closely, and rename the routine to have a trailing underscore.

This indeed solved my problem! I found that the concerned Routine was named there, but with no details at all (just one file)! Deleted it and it’s all good now. Thanks a lot for your super quick responses, Michael!