# ValueError: Number of passed names did not match number of header fields in the file

**URL:** <https://forum.biobakery.org/t/valueerror-number-of-passed-names-did-not-match-number-of-header-fields-in-the-file/5653>\
**Category:** MetaPhlAn\
**Created:** [July 17, 2023, 1:31pm UTC](https://forum.biobakery.org/t/valueerror-number-of-passed-names-did-not-match-number-of-header-fields-in-the-file/5653 "2023-07-17T13:31:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sunny\_sun](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/sunny_sun/32/2161_2.png) [@sunny\_sun](https://forum.biobakery.org/u/sunny_sun)\
**Post date:** [July 17, 2023, 1:31pm UTC](https://forum.biobakery.org/t/valueerror-number-of-passed-names-did-not-match-number-of-header-fields-in-the-file/5653/1 "2023-07-17T13:31:28Z")

</div>

metaphlan4  
command：merge\_metaphlan\_tables.py \*\_abundance\_metagenome.txt \> output/merged\_abundance\_table.txt  
error：  
Traceback (most recent call last):  
File “/home/bioinfo/sunyy/.conda/envs/mpa4/bin/merge\_metaphlan\_tables.py”, line 8, in   
sys.exit(main())  
File “/home/bioinfo/sunyy/.conda/envs/mpa4/lib/python3.7/site-packages/metaphlan/utils/merge\_metaphlan\_tables.py”, line 73, in main  
merge(args.aistms, open(args.o, ‘w’) if args.o else sys.stdout, args.gtdb\_profiles)  
File “/home/bioinfo/sunyy/.conda/envs/mpa4/lib/python3.7/site-packages/metaphlan/utils/merge\_metaphlan\_tables.py”, line 35, in merge  
iIn = pd.read\_csv(f, sep=‘\t’, skiprows=len(headers), names=names, usecols=[0,2] if not gtdb else range(2), index\_col=0)  
File “/home/bioinfo/sunyy/.local/lib/python3.7/site-packages/pandas/util/\_decorators.py”, line 311, in wrapper  
return func(\*args, \*\*kwargs)  
File “/home/bioinfo/sunyy/.local/lib/python3.7/site-packages/pandas/io/parsers/readers.py”, line 586, in read\_csv  
return \_read(filepath\_or\_buffer, kwds)  
File “/home/bioinfo/sunyy/.local/lib/python3.7/site-packages/pandas/io/parsers/readers.py”, line 482, in \_read  
parser = TextFileReader(filepath\_or\_buffer, \*\*kwds)  
File “/home/bioinfo/sunyy/.local/lib/python3.7/site-packages/pandas/io/parsers/readers.py”, line 811, in **init**  
self.\_engine = self.\_make\_engine(self.engine)  
File “/home/bioinfo/sunyy/.local/lib/python3.7/site-packages/pandas/io/parsers/readers.py”, line 1040, in \_make\_engine  
return mapping[engine](self.f, \*\*self.options) # type: ignore[call-arg]  
File “/home/bioinfo/sunyy/.local/lib/python3.7/site-packages/pandas/io/parsers/c\_parser\_wrapper.py”, line 69, in **init**  
self.\_reader = parsers.TextReader(self.handles.handle, \*\*kwds)  
File “pandas/\_libs/parsers.pyx”, line 542, in pandas.\_libs.parsers.TextReader. **cinit**  
File “pandas/\_libs/parsers.pyx”, line 770, in pandas.\_libs.parsers.TextReader.\_get\_header  
ValueError: Number of passed names did not match number of header fields in the file

---

<div class="post-metadata">

**Author:** ![aitor.blancomiguez](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/aitor.blancomiguez/32/86_2.png) [@aitor.blancomiguez](https://forum.biobakery.org/u/aitor.blancomiguez)\
**Post date:** [July 28, 2023, 2:04pm UTC](https://forum.biobakery.org/t/valueerror-number-of-passed-names-did-not-match-number-of-header-fields-in-the-file/5653/2 "2023-07-28T14:04:58Z")

</div>

Were all the profiles generated using the same metaphlan 4 code and database version?

---

<div class="post-metadata">

**Author:** ![Alessandro\_Lasorsa](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/alessandro_lasorsa/32/2631_2.png) [@Alessandro\_Lasorsa](https://forum.biobakery.org/u/Alessandro_Lasorsa)\
**Post date:** [January 5, 2024, 10:47am UTC](https://forum.biobakery.org/t/valueerror-number-of-passed-names-did-not-match-number-of-header-fields-in-the-file/5653/3 "2024-01-05T10:47:23Z")

</div>

In my case yes.  
I also have the same issue…

---

<div class="post-metadata">

**Author:** ![aitor.blancomiguez](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/aitor.blancomiguez/32/86_2.png) [@aitor.blancomiguez](https://forum.biobakery.org/u/aitor.blancomiguez)\
**Post date:** [March 5, 2024, 10:09am UTC](https://forum.biobakery.org/t/valueerror-number-of-passed-names-did-not-match-number-of-header-fields-in-the-file/5653/4 "2024-03-05T10:09:26Z")

</div>

Hi @Alessandro_Lasorsa  
Which params did you use to run metaphlan on the samples?
