| Reference | Downloads | Github

Can't save experiment in builder in ubuntu

OS Ubuntu 21.04
PsychoPy version 2021.2.0
Standard Standalone? (n)
What are you trying to achieve?: Trying to save a new experiment file created in builder

What did you try to make it work?: Opened psychopy, clicked ‘save current experiment as…’ button. Reboot, repeat. Tried also changing psychopy version in the settings.

What specifically went wrong when you tried that?:
When I click save experiment I get this error:

Traceback (most recent call last):
File “/home/jay/.local/lib/python3.9/site-packages/psychopy/app/builder/”, line 772, in fileSaveAs
self.fileSave(event=None, filename=newPath)
File “/home/jay/.local/lib/python3.9/site-packages/psychopy/app/builder/”, line 731, in fileSave
filename = self.exp.saveToXML(filename)
File “/home/jay/.local/lib/python3.9/site-packages/psychopy/experiment/”, line 329, in saveToXML
self.xmlRoot = self.xml
File “/home/jay/.local/lib/python3.9/site-packages/psychopy/experiment/”, line 314, in xml
File “/usr/lib/python3.9/xml/etree/”, line 244, in append
File “/usr/lib/python3.9/xml/etree/”, line 266, in _assert_is_element
raise TypeError(‘expected an Element, not %s’ % type(e).name)
TypeError: expected an Element, not Element

I don’t know if this is related or not, but there is also an font error saying " “WARNING /home/jay/.psychopy3/fonts/Consolas.truetype doesn’t have valid font family name”"

Do you have code looking for .name of something? If so, try removing it. I’d recommend posting the relevant code component here and what you expected it to do.

Hi, thanks for that. It happens with a completely blank experiment, as well as opening demo experiments and clicking save on them. So it’s not a variable that I’ve added.

I just noticed an additional font error message in the runner, which I don’t know if it’s related.
“WARNING /home/jay/.psychopy3/fonts/Consolas.truetype doesn’t have valid font family name”

Try installing 2021.2.1

It might be a failed installation.

Thanks that was it!
pip uninstall psychopy; pip install psychopy
and it’s working fine.

Thanks for your help!

Opps, spoke to soon. That didn’t work.

What I’ve figured out is that if I install following the recommended way:
pip install psychopy
Then psychopy 2021.2.0 installs, and works apart from not being able to save.

If I install from the outdated ubuntu package, using: sudo apt install psychopy
Then the outdated package, psychopy 2020.2.1 is installs, and has a host of errors, but can save files.
I see that there are a lot of posts in the forum about difficulty installing in ubuntu. Is it currently understood to work or to be broken?
I’ll try an conda install next, but am curious if others have got it to work recently.

Thanks for any advice

I can confirm that I can’t install via conda either. I see this is an issue others are having (e.g., PsychoPy install on 20.04 deprecated library ).

Should I persist or is it known to be broken on linux?


Hi everyone, have there been any developments on this? I am having the same issue when trying to install the new version 2021.2.3 on Ubuntu. However, 2021.1.4 is working fine. I can continue using the old version, but would be nice to know if there is a solution to this.