Failure to load PsychoPy experiment

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

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.

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.

Test 1 (low attentional load - not working).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.

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.

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

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

1 Like

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

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

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