# TypeError in importing Silva Taxonomy

**URL:** https://forum.qiime2.org/t/typeerror-in-importing-silva-taxonomy/3879
**Category:** Silva
**Tags:** taxonomy, silva, import
**Created:** [April 22, 2018, 6:41pm UTC](https://forum.qiime2.org/t/typeerror-in-importing-silva-taxonomy/3879 "2018-04-22T18:41:50Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![LauraMason](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/l/82dd89/32.png) [@LauraMason](https://forum.qiime2.org/u/LauraMason)
#### Post date: [April 22, 2018, 6:41pm UTC](https://forum.qiime2.org/t/typeerror-in-importing-silva-taxonomy/3879/1 "2018-04-22T18:41:50Z")

</div>

Continuing the discussion from [Taxonomy import for SILVA majority\_taxonomy\_all\_levels.txt](https://forum.qiime2.org/t/taxonomy-import-for-silva-majority-taxonomy-all-levels-txt/1877/6):

Hi there  
I am having some trouble importing a taxonomy file from the Qiime2 compatible Silva download. I followed the instructions from the linked conversation, but I then get a TypeError (below). Any ideas on how to fix this? I have converted the .txt file to a .tsv already and double checked that there was a tab between the accession no. and the taxonomy info.

Thanks,  
Laura

```
/home/LauraMason326/miniconda3/envs/qiime2-2017.12/lib/python3.5/site-packages/h5py/ __init__.py:34: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
Traceback (most recent call last):
  File "/home/LauraMason326/miniconda3/envs/qiime2-2017.12/lib/python3.5/site-packages/q2cli/tools.py", line 116, in import_data
    view_type=source_format)
  File "/home/LauraMason326/miniconda3/envs/qiime2-2017.12/lib/python3.5/site-packages/qiime2/sdk/result.py", line 214, in import_data
    return cls._from_view(type_, view, view_type, provenance_capture)
  File "/home/LauraMason326/miniconda3/envs/qiime2-2017.12/lib/python3.5/site-packages/qiime2/sdk/result.py", line 239, in _from_view
    result = transformation(view)
  File "/home/LauraMason326/miniconda3/envs/qiime2-2017.12/lib/python3.5/site-packages/qiime2/core/transform.py", line 59, in transformation
    new_view = transformer(view)
  File "/home/LauraMason326/miniconda3/envs/qiime2-2017.12/lib/python3.5/site-packages/qiime2/core/transform.py", line 207, in wrapped
    file_view = transformer(view)
  File "/home/LauraMason326/miniconda3/envs/qiime2-2017.12/lib/python3.5/site-packages/q2_types/feature_data/_transformer.py", line 177, in _20
    _taxonomy_formats_to_dataframe(str(ff), has_header=False))
  File "/home/LauraMason326/miniconda3/envs/qiime2-2017.12/lib/python3.5/site-packages/q2_types/feature_data/_transformer.py", line 83, in _taxonomy_formats_to_dataframe
    "are duplicated: %s" % ', '.join(df.index.get_duplicates()))
TypeError: sequence item 0: expected str instance, float found

An unexpected error has occurred:

  sequence item 0: expected str instance, float found

See above for debug info.

```

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [April 23, 2018, 3:42pm UTC](https://forum.qiime2.org/t/typeerror-in-importing-silva-taxonomy/3879/2 "2018-04-23T15:42:25Z")

</div>



---

<div class="post-metadata">

### Author: ![antgonza](https://forum.qiime2.org/user_avatar/forum.qiime2.org/antgonza/32/1236_2.png) [@antgonza](https://forum.qiime2.org/u/antgonza)
#### Post date: [April 23, 2018, 3:51pm UTC](https://forum.qiime2.org/t/typeerror-in-importing-silva-taxonomy/3879/4 "2018-04-23T15:51:40Z")

</div>

Hi @LauraMason,

Could you send us the full command you ran?

Thanks!

---

<div class="post-metadata">

### Author: ![antgonza](https://forum.qiime2.org/user_avatar/forum.qiime2.org/antgonza/32/1236_2.png) [@antgonza](https://forum.qiime2.org/u/antgonza)
#### Post date: [April 23, 2018, 3:51pm UTC](https://forum.qiime2.org/t/typeerror-in-importing-silva-taxonomy/3879/5 "2018-04-23T15:51:42Z")

</div>



---

<div class="post-metadata">

### Author: ![LauraMason](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/l/82dd89/32.png) [@LauraMason](https://forum.qiime2.org/u/LauraMason)
#### Post date: [April 23, 2018, 4:09pm UTC](https://forum.qiime2.org/t/typeerror-in-importing-silva-taxonomy/3879/6 "2018-04-23T16:09:55Z")

</div>

Here it is:

```
 qiime tools import --type FeatureData[Taxonomy] --input-path SILVA_132_QIIME_release/taxonomy/16S_only/97/taxonomy_7_levels.tsv 
    --output-path SILVA_132_QIIME_release/taxonomy/16S_only/97/taxonomy_7_levels.qza 
    --source-format HeaderlessTSVTaxonomyFormat

```

---

<div class="post-metadata">

### Author: ![antgonza](https://forum.qiime2.org/user_avatar/forum.qiime2.org/antgonza/32/1236_2.png) [@antgonza](https://forum.qiime2.org/u/antgonza)
#### Post date: [April 24, 2018, 2:27pm UTC](https://forum.qiime2.org/t/typeerror-in-importing-silva-taxonomy/3879/7 "2018-04-24T14:27:47Z")

</div>

Hi @LauraMason,

In the original thread there is an example of the first lines of majority\_taxonomy\_all\_levels.txt, could you make sure that `SILVA_132_QIIME_release/taxonomy/16S_only/97/taxonomy_7_levels.tsv` looks the same?

Thanks!

---

<div class="post-metadata">

### Author: ![LauraMason](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/l/82dd89/32.png) [@LauraMason](https://forum.qiime2.org/u/LauraMason)
#### Post date: [April 24, 2018, 3:06pm UTC](https://forum.qiime2.org/t/typeerror-in-importing-silva-taxonomy/3879/8 "2018-04-24T15:06:47Z")

</div>

The files look like they are set up similarly: [Accession][tab][taxonomic\_info].  
The main difference is that the majority\_taxonomy\_all includes up to 14 taxonomic levels, and my file includes only 7.

---

<div class="post-metadata">

### Author: ![antgonza](https://forum.qiime2.org/user_avatar/forum.qiime2.org/antgonza/32/1236_2.png) [@antgonza](https://forum.qiime2.org/u/antgonza)
#### Post date: [April 24, 2018, 3:07pm UTC](https://forum.qiime2.org/t/typeerror-in-importing-silva-taxonomy/3879/9 "2018-04-24T15:07:52Z")

</div>



---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [April 24, 2018, 10:58pm UTC](https://forum.qiime2.org/t/typeerror-in-importing-silva-taxonomy/3879/11 "2018-04-24T22:58:52Z")

</div>

> [@LauraMason](#):
>
> SILVA\_132\_QIIME\_release

Before I forget, have you had a chance to check out @gregcaporaso's SILVA 132 post?

> [@Silva 132 classifiers](https://forum.qiime2.org/t/silva-132-classifiers/3698):
>
> @William is in the process of preparing the Silva 132 QIIME-compatible release (thanks @William!), and we have prepared an initial version of the classifiers that can be used for testing purposes. It would be very helpful to get feedback from users of these classifiers to let us know if you're experiencing any issues or if they're working well for you (we're interested in feedback either way). You can reply to this post with your feedback. IMPORTANT: The Silva 132 QIIME-compatible release has n…

* * *

Hi @LauraMason - did you happen to edit or modify the `SILVA_132_QIIME_release/taxonomy/16S_only/97/taxonomy_7_levels.tsv` file at all? I ask because I just downloaded a fresh copy of SILVA 132 and ran the exact same command (without modifying any of the SILVA files) and it imported in about 1 second. The only thing that comes to mind besides that is I ran that import command in a 2018.2 environment (you appear to be running 2017.12), but I can't recall any changes to these formats that would account for that.

Looking forward to your response - we will get to the bottom of this! Thanks! 🦖

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [April 24, 2018, 10:58pm UTC](https://forum.qiime2.org/t/typeerror-in-importing-silva-taxonomy/3879/12 "2018-04-24T22:58:54Z")

</div>



---

<div class="post-metadata">

### Author: ![LauraMason](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/l/82dd89/32.png) [@LauraMason](https://forum.qiime2.org/u/LauraMason)
#### Post date: [April 25, 2018, 1:16pm UTC](https://forum.qiime2.org/t/typeerror-in-importing-silva-taxonomy/3879/13 "2018-04-25T13:16:37Z")

</div>

Hi @thermokarst

I re-downloaded the file & was able to convert it successfully. The first time I tired to upload this file however, I (when running the same command) got an error saying that the file was not in TaxonomyTSVFormat. I opened up the file to look closer, and found that one of the lines did not have a tab between the accession number and the taxonomy, so I added one. The file could then be recognized as a TaxonomyTSV file but generated the TypeError. So, in short, I modified the file, but I'm not really certain what happened beyond that or why it worked the second time.  
Thanks for your patience

---

<div class="post-metadata">

### Author: ![system](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/3X/2/1/21af5fe23cb6f4579467c66a9ed94e55274ca7bd.svg) [@system](https://forum.qiime2.org/u/system)
#### Post date: [May 26, 2018, 7:16pm UTC](https://forum.qiime2.org/t/typeerror-in-importing-silva-taxonomy/3879/14 "2018-05-26T19:16:39Z")

</div>

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
