# Error in merge\_metaphlan\_tables.py

**URL:** https://forum.biobakery.org/t/error-in-merge-metaphlan-tables-py/8028
**Category:** MetaPhlAn
**Created:** [April 28, 2025, 11:02pm UTC](https://forum.biobakery.org/t/error-in-merge-metaphlan-tables-py/8028 "2025-04-28T23:02:19Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Yosselin-UKY](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/yosselin-uky/32/3251_2.png) [@Yosselin-UKY](https://forum.biobakery.org/u/Yosselin-UKY)
#### Post date: [April 28, 2025, 11:02pm UTC](https://forum.biobakery.org/t/error-in-merge-metaphlan-tables-py/8028/1 "2025-04-28T23:02:19Z")

</div>

Hi there,

I am trying to merge metaphlan outputs into a table, however I’ve gotten this error.  
The script that I input here was: merge\_metaphlan\_tables.py \*.tsv \> merged\_abundance\_table.tsv

The metaphlan version that I was using is: MetaPhlAn4  
**The error was as follows:**  
Traceback (most recent call last):  
File “/home/yca231/.conda/envs/metaphlan4\_CE699/bin/merge\_metaphlan\_tables.py”, line 10, in   
sys.exit(main())  
File “/home/yca231/.conda/envs/metaphlan4\_CE699/lib/python3.6/site-packages/metaphlan/utils/merge\_metaphlan\_tables.py”, line 78, in main  
merge(args.aistms, sys.stdout)  
File “/home/yca231/.conda/envs/metaphlan4\_CE699/lib/python3.6/site-packages/metaphlan/utils/merge\_metaphlan\_tables.py”, line 46, in merge  
names = names,  
UnboundLocalError: local variable ‘names’ referenced before assignment

I appreciate your support!  
Thanks,  
Yosselin

---

<div class="post-metadata">

### Author: ![Claudia\_Mengoni](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/claudia_mengoni/32/2871_2.png) [@Claudia\_Mengoni](https://forum.biobakery.org/u/Claudia_Mengoni)
#### Post date: [May 19, 2025, 8:42am UTC](https://forum.biobakery.org/t/error-in-merge-metaphlan-tables-py/8028/2 "2025-05-19T08:42:06Z")

</div>

Hi @Yosselin-UKY can you make sure you haven’t removed headers with metaphlan version from your files (e.g. #mpa\_vJun23\_CHOCOPhlAnSGB\_202403) ?
