# Failure to load PsychoPy experiment

**URL:** <https://discourse.psychopy.org/t/failure-to-load-psychopy-experiment/1049>\
**Category:** Builder\
**Created:** [September 7, 2016, 8:26pm UTC](https://discourse.psychopy.org/t/failure-to-load-psychopy-experiment/1049 "2016-09-07T20:26:09Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![AJalkhi](https://avatars.discourse-cdn.com/v4/letter/a/848f3c/32.png) [@AJalkhi](https://discourse.psychopy.org/u/AJalkhi)\
**Post date:** [September 7, 2016, 8:26pm UTC](https://discourse.psychopy.org/t/failure-to-load-psychopy-experiment/1049/1 "2016-09-07T20:26:09Z")

</div>

Hello all,

I was wondering if anyone could help me, I have created an experiment using PsychoPy version 1.83.04 on a Mac. When I go to re-open the experiment everything is blank, all the trials I created are gone and it comes up with the following error message:

Welcome to PsychoPy2!  
v1.83.04  
Failed to load /Users/abijalkhi/Library/Mobile Documents/com~apple~CloudDocs/Part 2 Section 2/Project /Project Tests/Test 1 (Low attentional load). Please send the following to the PsychoPy user list  
Traceback (most recent call last):  
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/app/builder/builder.py”, line 4266, in fileOpen  
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/app/builder/experiment.py”, line 366, in loadFromXML  
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/xml/etree/ElementTree.py”, line 656, in parse  
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/xml/etree/ElementTree.py”, line 1642, in feed  
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/xml/etree/ElementTree.py”, line 1506, in \_raiseerror  
ParseError: not well-formed (invalid token): line 1, column 1

I saw something online about this happening because the file has not been saved with the correct extension, I checked mine and I think it is correct, the main programme is saved as (_.psyexp) and the coder as (_.py).

Thank you in advance, I would really appreciate the help,  
Abi

---

<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 8, 2016, 9:03am UTC](https://discourse.psychopy.org/t/failure-to-load-psychopy-experiment/1049/2 "2016-09-08T09:03:53Z")

</div>

Could you upload the _psyexp_ file here so we can see it? My guess is, indeed, that you’ve saved the python script with the _psyexp_ extension, so you’re trying to load a python script in Builder (won’t work).

If that is the case, and if you have a _psydat_ file from a time when your experiment wa successfully running then we might be able to extract your original builder experiment from that (PsychoPy attempts to save your study within the psydat data files). So you could post one of those as well if you have one.

---

<div class="post-metadata">

**Author:** ![AJalkhi](https://avatars.discourse-cdn.com/v4/letter/a/848f3c/32.png) [@AJalkhi](https://discourse.psychopy.org/u/AJalkhi)\
**Post date:** [September 8, 2016, 11:20am UTC](https://discourse.psychopy.org/t/failure-to-load-psychopy-experiment/1049/3 "2016-09-08T11:20:42Z")

</div>

Thanks for your response, I have tried to upload my experiment but as I’m a new user it says that I am not allowed.

---

<div class="post-metadata">

**Author:** ![AJalkhi](https://avatars.discourse-cdn.com/v4/letter/a/848f3c/32.png) [@AJalkhi](https://discourse.psychopy.org/u/AJalkhi)\
**Post date:** [September 8, 2016, 11:24am UTC](https://discourse.psychopy.org/t/failure-to-load-psychopy-experiment/1049/4 "2016-09-08T11:24:30Z")

</div>

[Test 1 (low attentional load - not working).psyexp](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/1X/ee38a025dc58df7fa0d5c40d3eab3e4a1a9d08fa.psyexp) (1.1 MB)

I have been upgraded so I have uploaded my experiment that is not working. I do not have a psydat file, but I have an older copy of my experiment so I can work from that if this one can not be fixed. I’m more interested in knowing what I did to make this happen so I can prevent this situation in the future.

Thank you.

---

<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 8, 2016, 11:32am UTC](https://discourse.psychopy.org/t/failure-to-load-psychopy-experiment/1049/5 "2016-09-08T11:32:47Z")

</div>

Yes, that is definitely a python script that has incorrectly been given the “psyexp” extension. I expect you saved it from the Coder view with the same filename as the builder experiment (including the psyexp extension) so you overwrote your experiment file with a python script and then tried to load it as an experiment again.

---

<div class="post-metadata">

**Author:** ![AJalkhi](https://avatars.discourse-cdn.com/v4/letter/a/848f3c/32.png) [@AJalkhi](https://discourse.psychopy.org/u/AJalkhi)\
**Post date:** [September 8, 2016, 11:46am UTC](https://discourse.psychopy.org/t/failure-to-load-psychopy-experiment/1049/6 "2016-09-08T11:46:53Z")

</div>

Thank you so much for your quick responses and solving this for me, I will be sure to save properly next time.

---

<div class="post-metadata">

**Author:** ![oliviad](https://avatars.discourse-cdn.com/v4/letter/o/8e7dd6/32.png) [@oliviad](https://discourse.psychopy.org/u/oliviad)\
**Post date:** [April 12, 2018, 8:38am UTC](https://discourse.psychopy.org/t/failure-to-load-psychopy-experiment/1049/7 "2018-04-12T08:38:47Z")

</div>

Hi!

I have had exactly the same problem. I can run the experiment from the experiment\_lastrun.py, but is there a way of restoring the builder view?

Your help is much appreciated.

Olivia

---

<div class="post-metadata">

**Author:** ![Xinzhu-Fang](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/xinzhu-fang/32/4878_2.png) [@Xinzhu-Fang](https://discourse.psychopy.org/u/Xinzhu-Fang)\
**Post date:** [October 13, 2018, 5:32pm UTC](https://discourse.psychopy.org/t/failure-to-load-psychopy-experiment/1049/8 "2018-10-13T17:32:35Z")

</div>

I want to build from script too. How to do that?

---

<div class="post-metadata">

**Author:** ![Michael](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/michael/32/16_2.png) [@Michael](https://discourse.psychopy.org/u/Michael)\
**Post date:** [October 15, 2018, 7:19am UTC](https://discourse.psychopy.org/t/failure-to-load-psychopy-experiment/1049/9 "2018-10-15T07:19:08Z")

</div>

You can’t. Going from the Builder representation to a Python script is a one-way journey.

---

<div class="post-metadata">

**Author:** ![kobitours](https://avatars.discourse-cdn.com/v4/letter/k/f6c823/32.png) [@kobitours](https://discourse.psychopy.org/u/kobitours)\
**Post date:** [May 13, 2022, 6:08pm UTC](https://discourse.psychopy.org/t/failure-to-load-psychopy-experiment/1049/10 "2022-05-13T18:08:02Z")

</div>

Hi Jon,

You wrote to AKalkhi “PsychoPy attempts to save your study within the psydat data files”.  
My .psyexp file was deleted, can i recover it from .psydat file?

tx
