Hello, I am very new to PsychoPy and coding in general, hence I rely a lot on the Builder aspect. I have made an experiment using the Builder component only, and was able to run it with no problems before I save it to my experiment file and close PsychoPy.
However, after I close PsychoPy and open my saved experiment again, it does not load. The flow view indicates no trial whatsover. This is what the situation it looks like:
I have restarted my computer, and reinstalled PsychoPy as well, but I still get the same error. Below are some details:
OS (e.g. Win10): Win10 PsychoPy version (e.g. 1.84.x): 1.84.1 Standard Standalone? (y/n) : Y What are you trying to achieve?: Loading and running my experiment
What specifically went wrong when you tried that?:
This is the error message I got:
Failed to load C:\Users\user\Desktop\Time Judgment Task\ordinal_comparison_fullAB.psyexp. Please send the following to the PsychoPy user list
Traceback (most recent call last):
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.84.1-py2.7.egg\psychopy\app\builder\builder.py”, line 1473, in fileOpen
self.exp.loadFromXML(filename)
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.84.1-py2.7.egg\psychopy\app\builder\experiment.py”, line 596, in loadFromXML
self.flow.append(self.routines[elementNode.get(‘name’)])
KeyError: ‘trial’
Somehow you’ve managed to delete the Routine called ‘trial’ but it remained on the Flow. Any idea what you did leading up to this? (PsychoPy shouldn’t allow that to be possible).
We can fix it by opening the .psyexp file in a text editor rather than in PsychoPy. There will be a line towards the end of the file adding the trial routine into the flow and that needs deleting. Make a copy of the file first, in case you really mess it up, and/or upload a copy to this thread for us to help fix it.
I did delete the routine called ‘trial’ that appears whenever you open a new experiment. Then, I inserted new trials and loops that make up my experiment.
I followed what you advised and removed the flow part which you mentioned needs deleting. However, I still face the same problem.
I went through the same a while ago and the best thing you can do, if you have enough time and the flow is not that long, is to create a new file and start fresh BUT without deleting the default trial at the beginning.
I opened your file and I got the same message even when running the experiment in the coder.
In your case there was an issue with “trial” but also an issue finding “StimA” which I think you might have renamed to “FaceA”? The file below appears to open and load the Flow correctly but check the routines are the right ones.
Hi Jon,
The file seems to open and load correctly now with the right routines.
Yes, I think I had renamed some routines, so that is most likely what is causing the problem.