# Error when trying to open .psyexp file

**URL:** <https://discourse.psychopy.org/t/error-when-trying-to-open-psyexp-file/1184>\
**Category:** Builder\
**Created:** [September 29, 2016, 10:18am UTC](https://discourse.psychopy.org/t/error-when-trying-to-open-psyexp-file/1184 "2016-09-29T10:18:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MTJonesUK](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/mtjonesuk/32/170_2.png) [@MTJonesUK](https://discourse.psychopy.org/u/MTJonesUK)\
**Post date:** [September 29, 2016, 10:18am UTC](https://discourse.psychopy.org/t/error-when-trying-to-open-psyexp-file/1184/1 "2016-09-29T10:18:53Z")

</div>

Hi all…

I am helping a colleague to use PsychoPy and she had her experiment all up and running but today when she tried to open the file it will not open. It starts to open PsychoPy but then ‘PsychoPy2 Error’ appears and it shuts down. This is using PsychoPy2 on Mac - version 1.84.1.

The experiment does open and run in coder but just not in builder.

Below are the logs from console. They mean nothing to me but maybe they might shed light on the issue to one of you.

Thanks  
Matt

```auto
29/09/2016 11:02:43.953 PsychoPy2[5172]: Failed to load /Users/mattjones/Desktop/BETask/beTask.psyexp. Please send the following to the PsychoPy user list
29/09/2016 11:02:43.953 PsychoPy2[5172]: Traceback (most recent call last):
29/09/2016 11:02:43.954 PsychoPy2[5172]: File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/app/builder/builder.py", line 1473, in fileOpen
29/09/2016 11:02:43.954 PsychoPy2[5172]: File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/app/builder/experiment.py", line 596, in loadFromXML
29/09/2016 11:02:43.954 PsychoPy2[5172]: KeyError: 'response_2'
29/09/2016 11:02:43.988 PsychoPy2[5172]: Traceback (most recent call last):
29/09/2016 11:02:43.988 PsychoPy2[5172]: File "/Applications/PsychoPy2.app/Contents/Resources/ __boot__.py", line 381, in <module>
29/09/2016 11:02:43.989 PsychoPy2[5172]: _run()
29/09/2016 11:02:43.989 PsychoPy2[5172]: File "/Applications/PsychoPy2.app/Contents/Resources/ __boot__.py", line 362, in _run
29/09/2016 11:02:43.989 PsychoPy2[5172]: exec(compile(source, path, 'exec'), globals(), globals())
29/09/2016 11:02:43.989 PsychoPy2[5172]: File "/Applications/PsychoPy2.app/Contents/Resources/psychopyApp.py", line 60, in <module>
29/09/2016 11:02:43.989 PsychoPy2[5172]: app = PsychoPyApp(0, showSplash=showSplash)
29/09/2016 11:02:43.989 PsychoPy2[5172]: File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/app/_psychopyApp.py", line 107, in __init__
29/09/2016 11:02:43.989 PsychoPy2[5172]: self.onInit(**kwargs)
29/09/2016 11:02:43.989 PsychoPy2[5172]: File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/app/_psychopyApp.py", line 254, in onInit
29/09/2016 11:02:43.989 PsychoPy2[5172]: self.showBuilder(fileList=exps)
29/09/2016 11:02:43.989 PsychoPy2[5172]: File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/app/_psychopyApp.py", line 436, in showBuilder
29/09/2016 11:02:43.989 PsychoPy2[5172]: self.newBuilderFrame(fileName=fileName)
29/09/2016 11:02:43.989 PsychoPy2[5172]: File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/app/_psychopyApp.py", line 426, in newBuilderFrame
29/09/2016 11:02:43.989 PsychoPy2[5172]: fileName=fileName, app=self)
29/09/2016 11:02:43.989 PsychoPy2[5172]: File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/app/builder/builder.py", line 1013, in __init__
29/09/2016 11:02:43.989 PsychoPy2[5172]: self.fileOpen(filename=fileName, closeCurrent=False)
29/09/2016 11:02:43.989 PsychoPy2[5172]: File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/app/builder/builder.py", line 1485, in fileOpen
29/09/2016 11:02:43.989 PsychoPy2[5172]: self.updateAllViews() # if frozen effect will be visible on thaw
29/09/2016 11:02:43.990 PsychoPy2[5172]: File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/app/builder/builder.py", line 1718, in updateAllViews
29/09/2016 11:02:43.990 PsychoPy2[5172]:     
29/09/2016 11:02:43.990 PsychoPy2[5172]: self.flowPanel.draw()
29/09/2016 11:02:43.990 PsychoPy2[5172]: File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/app/builder/flow.py", line 644, in draw
29/09/2016 11:02:43.990 PsychoPy2[5172]: thisTerm = self.loops[thisLoop]['term']
29/09/2016 11:02:43.990 PsychoPy2[5172]: KeyError: 'term'
29/09/2016 11:02:44.049 PsychoPy2[5172]: PsychoPy2 Error

```

---

<div class="post-metadata">

**Author:** ![MTJonesUK](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/mtjonesuk/32/170_2.png) [@MTJonesUK](https://discourse.psychopy.org/u/MTJonesUK)\
**Post date:** [September 29, 2016, 10:41am UTC](https://discourse.psychopy.org/t/error-when-trying-to-open-psyexp-file/1184/2 "2016-09-29T10:41:39Z")

</div>

I notice that I can actually open the file from within Builder and it then runs but the GUI doesnt show any of the loops and routines and at it just looks like a new and untitled experiment file. But when I click run it actually runs the experiment. It does mean that I cannot edit the file though.

It also appears this person is having the same issue:

> [@Issues with PsychoPy GUI](http://discourse.psychopy.org/t/issues-with-psychopy-gui/1176):
>
> OS (e.g. Win10): OS X PsychoPy version (e.g. 1.84.x): 1.84.1 Standard Standalone? (y) What are you trying to achieve?: I am trying to run an experiment that contains a mental rotation task and a main task containing image pairs. There are 3 blocks of 15 degree steps for the mental rotation and 2 blocks of 48 image pairs for the main task. I created two loops (one of the mental rotation task and one for the main task) to run the experiment with instructions for each task. Each loop is based …

---

<div class="post-metadata">

**Author:** ![jon](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/jon/32/22_2.png) [@jon](https://discourse.psychopy.org/u/jon)\
**Post date:** [September 29, 2016, 11:23am UTC](https://discourse.psychopy.org/t/error-when-trying-to-open-psyexp-file/1184/3 "2016-09-29T11:23:56Z")

</div>

This is a duplicate of the issue below. I’ve posted the fix at the bottom of that thread.

> [@PsychoPy experiment doesn't load](http://discourse.psychopy.org/t/psychopy-experiment-doesnt-load/1052/7):
>
> 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 d…
