# Applet for merging multiple .psyexp files

**URL:** <https://discourse.psychopy.org/t/applet-for-merging-multiple-psyexp-files/15822>\
**Category:** Builder\
**Created:** [August 19, 2020, 2:03pm UTC](https://discourse.psychopy.org/t/applet-for-merging-multiple-psyexp-files/15822 "2020-08-19T14:03:15Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajus](https://avatars.discourse-cdn.com/v4/letter/a/dc4da7/32.png) [@ajus](https://discourse.psychopy.org/u/ajus)\
**Post date:** [August 19, 2020, 2:03pm UTC](https://discourse.psychopy.org/t/applet-for-merging-multiple-psyexp-files/15822/1 "2020-08-19T14:03:15Z")

</div>

Hi!

I often use different combinations of the same paradigms in my research, but copy-pasting routines and rebuilding loops every time is a nuisance. So I wrote a little applet to facilitate merging experiments. It allows me to upload multiple .psyexp files and checks if there is any overlap in the component and routine names. If not, it lets me sort the experiments in the intended order and download the merged result. I thought it may also be useful for other people, so I uploaded it here: [https://adjus.shinyapps.io/PsychoPyMerger/](https://adjus.shinyapps.io/PsychoPyMerger/). Feel free to use it and give feedback.

Best,  
Adrian

---

<div class="post-metadata">

**Author:** ![trishabhugra](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/trishabhugra/32/30448_2.png) [@trishabhugra](https://discourse.psychopy.org/u/trishabhugra)\
**Post date:** [July 27, 2021, 12:10pm UTC](https://discourse.psychopy.org/t/applet-for-merging-multiple-psyexp-files/15822/2 "2021-07-27T12:10:02Z")

</div>

hello! i am not able two upload two files simultaneously on the link. please help

---

<div class="post-metadata">

**Author:** ![ajus](https://avatars.discourse-cdn.com/v4/letter/a/dc4da7/32.png) [@ajus](https://discourse.psychopy.org/u/ajus)\
**Post date:** [August 4, 2021, 1:23pm UTC](https://discourse.psychopy.org/t/applet-for-merging-multiple-psyexp-files/15822/3 "2021-08-04T13:23:51Z")

</div>

Hi, sorry for the late reply. It normally should work fine with multiple files. Make sure that all the files are in one directory so you can select them all at once without changing the directory.

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [August 4, 2021, 2:01pm UTC](https://discourse.psychopy.org/t/applet-for-merging-multiple-psyexp-files/15822/4 "2021-08-04T14:01:41Z")

</div>

Please could you add it to [PsychoPy Online Demos](https://discourse.psychopy.org/t/psychopy-online-demos/22319) to help people find it?

---

<div class="post-metadata">

**Author:** ![ajus](https://avatars.discourse-cdn.com/v4/letter/a/dc4da7/32.png) [@ajus](https://discourse.psychopy.org/u/ajus)\
**Post date:** [August 4, 2021, 3:14pm UTC](https://discourse.psychopy.org/t/applet-for-merging-multiple-psyexp-files/15822/5 "2021-08-04T15:14:53Z")

</div>

I did, thanks for making me aware of this thread!

---

<div class="post-metadata">

**Author:** ![Luke](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/luke/32/30321_2.png) [@Luke](https://discourse.psychopy.org/u/Luke)\
**Post date:** [August 10, 2021, 3:01pm UTC](https://discourse.psychopy.org/t/applet-for-merging-multiple-psyexp-files/15822/6 "2021-08-10T15:01:31Z")

</div>

Are you planning to release a Github-Repo of the Code? I would like to extend the Shiny-App a little bit.  
Or maybe we can collaborate to extend it.

Would be great!

---

<div class="post-metadata">

**Author:** ![ajus](https://avatars.discourse-cdn.com/v4/letter/a/dc4da7/32.png) [@ajus](https://discourse.psychopy.org/u/ajus)\
**Post date:** [August 12, 2021, 2:31pm UTC](https://discourse.psychopy.org/t/applet-for-merging-multiple-psyexp-files/15822/7 "2021-08-12T14:31:07Z")

</div>

Hi Luke, I sent you a message to discuss this.

---

<div class="post-metadata">

**Author:** ![InesM](https://avatars.discourse-cdn.com/v4/letter/i/ce73a5/32.png) [@InesM](https://discourse.psychopy.org/u/InesM)\
**Post date:** [January 30, 2024, 2:47pm UTC](https://discourse.psychopy.org/t/applet-for-merging-multiple-psyexp-files/15822/8 "2024-01-30T14:47:50Z")

</div>

Hi @ajus,  
I tried to use your applet and everything went fine until I tried to open the outcome Psychopy merged project. Psychopy seems to try to open the project and then shut down for no apprearent reason 😕 I’m working with Psychopy 2022.2.5. Can this problem be linked with this version ?  
Thanks in advance

---

<div class="post-metadata">

**Author:** ![Liberos](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/liberos/32/5902_2.png) [@Liberos](https://discourse.psychopy.org/u/Liberos)\
**Post date:** [December 17, 2024, 12:18am UTC](https://discourse.psychopy.org/t/applet-for-merging-multiple-psyexp-files/15822/9 "2024-12-17T00:18:36Z")

</div>

PsychoPy Merger did identify replicated names between my two tasks. I updated them, then they merged.

However, trying to open them in 2024.2.3 after the merge I get:

> Traceback (most recent call last):  
> File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.10/psychopy/app/coder/coder.py”, line 2374, in fileOpen  
> File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.10/psychopy/app/\_psychopyApp.py”, line 863, in newBuilderFrame  
> File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.10/psychopy/app/builder/builder.py”, line 197, in **init**  
> File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.10/psychopy/app/builder/builder.py”, line 764, in fileOpen  
> File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.10/psychopy/app/builder/builder.py”, line 1088, in updateAllViews  
> File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.10/psychopy/app/builder/builder.py”, line 4138, in draw  
> KeyError: ‘term’

During the merge it posted **There are no duplicate component or routine names. You’re good to go!** , so I was not surprised I could not find “term” in either experiment.

During the merge I _did_ get the error message “The experiments have different settings.  
The settings of the first experiment are used, this might cause problems.”, but no indication what setting or where. There are “Preferences” for PsychyPy and “Properties” for experiments. I’m guessing “Settings” means “Properties” probably?

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [August 19, 2026, 9:47am UTC](https://discourse.psychopy.org/t/applet-for-merging-multiple-psyexp-files/15822/10 "2026-08-19T09:47:47Z")

</div>

I’ve just been searching for threads containing KeyError: ‘term’ and came across this one, which fits with the probable cause of renamed routines.

Here is the most recent thread about the issue.

> [@Experiment won't open- Unhandled internal error](https://discourse.psychopy.org/t/experiment-wont-open-unhandled-internal-error/47677):
>
> Hi, I encountered this error seemingly out of nowhere and can’t figure out what the issue is. I’m super new to Psychopy and programming in general so any help would be super appreciated. Traceback (most recent call last): File “/Applications/PsychoPy 2.app/Contents/Resources/lib/python3.10/psychopy/app/builder/builder.py”, line 1038, in OnFileHistory File “/Applications/PsychoPy 2.app/Contents/Resources/lib/python3.10/psychopy/app/builder/builder.py”, line 800, in fileOpen File “/Application…
