# Anndata Import Error with 0.8.0

**URL:** <https://help.galaxyproject.org/t/anndata-import-error-with-0-8-0/8781>\
**Category:** Uncategorized\
**Tags:** troubleshooting, single-cell\
**Created:** [October 3, 2022, 8:31pm UTC](https://help.galaxyproject.org/t/anndata-import-error-with-0-8-0/8781 "2022-10-03T20:31:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![glbarlow](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/glbarlow/32/3706_2.png) [@glbarlow](https://help.galaxyproject.org/u/glbarlow)\
**Post date:** [October 3, 2022, 8:31pm UTC](https://help.galaxyproject.org/t/anndata-import-error-with-0-8-0/8781/1 "2022-10-03T20:31:43Z")

</div>

Was having issues uploading h5ad files to galaxy (see error below). Turned out I was saving files with scanpy but the version of anndata was 0.8. Replacing anndata with 0.7.8 and writing with scanpy resolved the issue. Thought this may help someone.

Steps

1. Downloaded " Single Cell Phenotyping on data 270 and data 317" from [Galaxy](https://cancer.usegalaxy.org/datasets/81e14dc880c8bcdf/details).
2. Uploaded to squidpy tool in galaxy-me–\>worked fine
3. read in file with anndata .8 and immediate re-wrote as new file. Uploaded to galaxy-me squidpy tool and got error below.
4. Uninstalled anndata and installed anndata 0.7.8 and repeated step 3–\>worked fine

Error:  
Traceback (most recent call last):  
File “/usr/local/lib/python3.8/dist-packages/anndata/\_io/utils.py”, line 177, in func\_wrapper  
return func(elem, \*args, \*\*kwargs)  
File “/usr/local/lib/python3.8/dist-packages/anndata/\_io/h5ad.py”, line 527, in read\_group  
EncodingVersions[encoding\_type].check(  
File “/usr/lib/python3.8/enum.py”, line 387, in **getitem**  
return cls._member\_map_[name]  
KeyError: ‘dict’  
During handling of the above exception, another exception occurred:  
…

line 29, in main  
adata = read\_h5ad(anndata)  
File “/usr/local/lib/python3.8/dist-packages/anndata/\_io/h5ad.py”, line 421, in read\_h5ad  
d[k] = read\_attribute(f[k])  
File “/usr/lib/python3.8/functools.py”, line 875, in wrapper  
return dispatch(args[0]. **class** )(\*args, \*\*kw)  
File “/usr/local/lib/python3.8/dist-packages/anndata/\_io/utils.py”, line 183, in func\_wrapper  
raise AnnDataReadError(  
anndata.\_io.utils.AnnDataReadError: Above error raised while reading key ‘/layers’ of type \<class ‘h5py.\_hl.group.Group’\> from /.

---

<div class="post-metadata">

**Author:** ![jennaj](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/jennaj/32/27_2.png) [@jennaj](https://help.galaxyproject.org/u/jennaj)\
**Post date:** [October 4, 2022, 12:18am UTC](https://help.galaxyproject.org/t/anndata-import-error-with-0-8-0/8781/2 "2022-10-04T00:18:15Z")

</div>

Hi @glbarlow

Forwards and backwards compatibility between the **anndata** versions mentioned, and between other prior versions, is a clear technical challange but we don’t have any Q&A at this forum about it. Thanks for posting your help 🚀 I also created a tag for it specifically. This will be the first topic associated.

**What Galaxy currently provides:**

- We try to document requirements in places that are directly accessible in the GUI to scientists. Below is one example of the key places to review a tool form – in addition to any details around input/parameter inputs and in the middle Help section.

- The Dataset Information view ( ℹ icon) also includes dependency information, but that is only available _after_ a tool is used (lists what was actually used).

- Tutorials include FAQ notes [like this](https://training.galaxyproject.org/training-material/topics/transcriptomics/tutorials/scrna-scanpy-pbmc3k/faqs/anndata_not_working.html) (training-data/method-version vs tool-wrapper-versions).

- Galaxy itself also has some [open issues](https://github.com/galaxyproject/galaxy/issues?q=is%3Aissue+anndata).

- Arguably, this tool could use a bit more information. Maybe the expected “data version range”, directly under the input selection area? With more in the Help section? If you or anyone else reading would like to help with that, or suggest the text to add, please open a request issue [here](https://github.com/galaxyproject/tools-iuc/issues) or a PR against the development repository [here](https://github.com/galaxyproject/tools-iuc/tree/master/tools/anndata/).

* * *

**XRef** : for context, `anndata` specification issues with scientific community and author discussion are (at least) [here](https://github.com/scverse/anndata/issues/698) and [here](https://github.com/scverse/anndata/issues/699)

* * *

---

<div class="post-metadata">

**Author:** ![jennaj](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/jennaj/32/27_2.png) [@jennaj](https://help.galaxyproject.org/u/jennaj)\
**Post date:** [December 20, 2023, 7:54pm UTC](https://help.galaxyproject.org/t/anndata-import-error-with-0-8-0/8781/3 "2023-12-20T19:54:32Z")

</div>


