| Reference | Downloads | Github

Persisting but non-existing routine - cannot get rid of it

Windows 7, 64bit
PsychoPy 1.90.2

Dear All,

I have a rather strange problem and any advice would be much appreciated.

I have an exp created using builder.
At the process of renaming routines, PsychoPy crashed.

After I reopened it I have a routine that keeps appearing but I cannot remove it (see screenshot below).
Below in bullet points some info about the problem:

  • The routine is populated with all the components in inserted before the crash.
  • The routine does not appear in the flow but I can insert it via “Insert Routine” function.
  • Strangely enough the routine is suffixed and prefixed with single quotes plus the letter ‘b’ (the original name of the routine was only BF_Code_2 the rest is not my doing).
  • I can just press the X on the routine’s tab and remove it but it will re-appear next time i open the exp again.
  • I have already deleted all the .lastrun .pyc files just in case.
  • There is nothing in the coder that can help me.
  • If i try to insert in another routine a component with the same name as a component in the problematic routine then it will give me an error so the routine must exist somewhere.

Any advice much welcomed.


Hi Yiannis,
maybe you could make a backup copy of your psyexp file, open it with a text editor (the code is easy to read), search for the broken code associated with the BF_Code_2 component and remove it.

Thanks for your reply.

Ah, had done that already. The routine is nowhere to be found let alone editing it. I also deleted the routine in the builder and then “saved as” and still the routine is there. Deleted user preferences and .cfg data… Still there. Log files do not show anything that can help. I run out of options/ideas hence my post here.

It seems to me my file is “corrupted”

Hm, I really would have expected the string BF_Code_2 somewhere in there, too. Can you upload the psyexp file here?


Just wanted to check if the routine will appear again when opening the exp in my personal laptop (and of course it did) before I reply. I have also removed all the components from that routine.

For your enjoyment only here is the .psyexp

your_expV3.psyexp (58.9 KB)

Exp is unfinished. It is when I was creating the second part of the exp when the problem appeared (i.e. second code routine and whatever is in the trials_2 loop).

Good luck and let me know how it goes.


Thanks for the file. I did what I wrote above (it was line 604) and it seems to be working.
your_expV3.1.psyexp (58.8 KB)

1 Like

I misunderstood your advice. I thought a “Save as” and then opening it in the code view was the same as what you said but apparently not.

Many thanks for that, your time is appreciated.

Marked as solved.

Ok, I’m glad it helped. Yes, I edited the psyexp file directly, not the Python script (py) that you get by running/compiling Builder experiments or by working in Coder.