I made a new experiment using the Builder view, but when I try to load it, it fails and I get the following error message
Failed to load C:\Users\adrian\Insync\Work\Projects\SoL\Pic viewing 1.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'
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 1634, in OnFileHistory
self.fileOpen(filename=path)
File "C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.84.1-py2.7.egg\psychopy\app\builder\builder.py", line 1485, in fileOpen
self.updateAllViews() # if frozen effect will be visible on thaw
File "C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.84.1-py2.7.egg\psychopy\app\builder\builder.py", line 1718, in updateAllViews
self.flowPanel.draw()
File "C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.84.1-py2.7.egg\psychopy\app\builder\flow.py", line 644, in draw
thisTerm = self.loops[thisLoop]['term']
KeyError: 'term'
Iām using the latest version of PsychoPy on Windows 10.
Adrian
Edit - very limited investigation suggests it might be something to do with trying to preload an image during an ISI period. Possibly an avenue for investigation?
One way to corrupt an experiment file is certainly to set a stimulus to update during a static period (e.g. ISI) and then delete that static period. Iām not sure if thatās what youāve done though. Could you post the experiment file so we can take a look, but also post any hints about what you did before the problem started happening? The error message is complaining about a missing object ātrialā and a missing object ātermā so itās probably related to those objects/variables
I donāt āthinkā I created and then deleted a static period (but I might be wrong). Although, I might have deleted/modified the default ātrialā routine that might have contained a static period. Iām also displaying a fixation cross during the static period (but itās onset and offset are not within the static period). I donāt remember naming anything ātermā though. Iāve uploaded the troublesome psyexp file.
I believe you found a new way to break the static period, by renaming a routine that contained one. Weāll have to add that to the list of static component errors.
But the fix was actually easy when you know how: your experiment was complaining that it couldnāt find the ātrialā routine so I opened the experiment in a text editor and removed the line where it tried to use the ātrialā. Then the experiment would load again, just with a gap in your flow where the ātrialā had been.
I had a similar issue yesterday (just as I was about to demonstrate a practical prototype to a lecturer :-S) - it looks like when routines are renamed they are not removed from the namespace immediately (for instance, if you rename a trial called trial as trial, the routine is named trial_2.
Interestingly been getting some weird flow errors too - for instance in the replication below all the flow representations have vanished but the experiment still worksā¦
We think this was caused by renaming a Routine; this was a new feature and apparently not working correctly as of 1.84.1. The bug that led to this issue is now fixed and will be included in next release (1.84.2).
For anyone else having this issue you can fix your file manually like this (make a copy of your experiment first in case you really mess it up!):
open your .psyexp file in a text editor (e.g. notepad+ on windows, textwrangler on mac)
near the bottom of the file youāll see a section describing the Flow
find the line referring to the Routine name that you changed (no longer exists) and simply change it to the name you changed it to (exactly, with matching capitals)
For example, if you changed the trial routine to be called presentPics then you find/need to change the like this:
If you canāt make that work then post a copy of your experiment here for us to change for you (folks you can āunwatchā this thread if you donāt want updates!)
If I replace <Routine name="response_2"/>
with <Routine name="confidence_2"/>
the experiment works, and confidence_2 was otherwise not on the Flow, so Iāve got a strong suspicion there was a ārenameā performed at some stage
Which is fine - you did the right thing - itās just that we had a bug in the renaming.
I was having a similar problem, but wasnāt able to figure out the solution. I have attached my psychoPy experiment here if anyone wants to take a look and help me out. Thank you in advance.
As explained in the rest of this thread, these errors are coming about from Routines that have been renamed and they can be fixed in a text editor.
In your case you created a routine called InsterStimInt and then renamed it to InterStimInt so you needed to find the line that said <Routine name="InsterStimInt"/>
and replace it with <Routine name="InterStimInt"/>
Also, in the new release (1.84.2) Iāve set it to at least load the experiment when this has gone wrong and all youāll need to do is re-insert any missing Routines (ones that have been renamed) back into your Flow.
I am running into this same bug with version 3.05 (Mac 10.13.6). Further, when I open my experiment, no flow appears in the builder. When I try to run the experiment anyways, it does not result in an error either-it just exits out of the experiment before it can start and returns me back to the builder. I know it has to do with the fact that I renamed ISI and sound components. Therefore, I have been looking really closely through the file in a Text Editor to see if there is a mismatch among component names. Unfortunately, I cannot find anything that is misnamed (I may have not seen something). The only thing I see is that the āflowā segment of the code is missing in the text editor file. It does not show any information pertaining to the flow of the experiment.
I have attached a screenshot of the builder without the flow diagram and have uploaded my experiment (the experiment is a second version as i have already created a copy in accordance with your suggestion above). I really appreciate your help!