# Issue with huggingface.load\_dataset()

**URL:** <https://discuss.huggingface.co/t/issue-with-huggingface-load-dataset/134809>\
**Category:** Spaces\
**Created:** [January 8, 2025, 8:57am UTC](https://discuss.huggingface.co/t/issue-with-huggingface-load-dataset/134809 "2025-01-08T08:57:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![leomaurodesenv](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/leomaurodesenv/32/50249_2.png) [@leomaurodesenv](https://discuss.huggingface.co/u/leomaurodesenv)\
**Post date:** [January 8, 2025, 8:57am UTC](https://discuss.huggingface.co/t/issue-with-huggingface-load-dataset/134809/1 "2025-01-08T08:57:57Z")

</div>

Hello, I recently encountered an issue with the function `huggingface.load_dataset()` that raised the following error:

```auto
Error: KeyError: ‘tags’

```

In an attempt to resolve this, I found a tutorial ([link here](https://discuss.huggingface.co/t/huggingface-dataset-install/133279/5)), which suggested updating the `huggingface_hub` library in the `requirements.txt` file. I followed the tutorial and updated the `huggingface_hub` version accordingly. However, after this update, I am now facing a different error.

```auto
--> ERROR: docker.io/library/python:3.1: not found

```

Can anyone help with understanding why this update is causing an issue and how I can fix it?  
Space: [QASports Website - Basketball - a Hugging Face Space by leomaurodesenv](https://huggingface.co/spaces/leomaurodesenv/qasports-website)

---

<div class="post-metadata">

**Author:** ![Alanturner2](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/alanturner2/32/37542_2.png) [@Alanturner2](https://discuss.huggingface.co/u/Alanturner2)\
**Post date:** [January 8, 2025, 9:05am UTC](https://discuss.huggingface.co/t/issue-with-huggingface-load-dataset/134809/2 "2025-01-08T09:05:09Z")

</div>

Hi! It seems like you’ve encountered two distinct issues after updating the `huggingface_hub` library.

1. **KeyError: ‘tags’** – This error usually occurs when the dataset you’re trying to load has missing metadata or if you’re using an incompatible version of the dataset. It could also be caused by outdated versions of `datasets` or `huggingface_hub`. Updating both might help resolve this.

2. **ERROR: [Docker Hub Container Image Library | App Containerization](http://docker.io/library/python:3.1:) not found** – This issue is due to the use of a non-existent Docker image. The `python:3.1` image does not exist (the latest stable version of Python is 3.10 or 3.11). You should update your Dockerfile or requirements to use a valid image, such as `python:3.8`, `python:3.9`, or `python:3.10`.

### Suggested Fix:

- Roll back or update your Hugging Face libraries to ensure compatibility:

```bash
pip install --upgrade huggingface_hub datasets

```

- Correct the Docker image reference:
  - Update your Dockerfile to use a valid Python image, e.g.:

```dockerfile
FROM python:3.9

```

Hope this help!

---

<div class="post-metadata">

**Author:** ![leomaurodesenv](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/leomaurodesenv/32/50249_2.png) [@leomaurodesenv](https://discuss.huggingface.co/u/leomaurodesenv)\
**Post date:** [January 8, 2025, 11:38am UTC](https://discuss.huggingface.co/t/issue-with-huggingface-load-dataset/134809/3 "2025-01-08T11:38:52Z")

</div>

Hello @Alanturner2 , thank you for your suggestions.

Do you know how can I change the Docker image? I am using [Streamlit Spaces](https://huggingface.co/docs/hub/en/spaces-sdks-streamlit), thus it is not clear for me how to do that.

[Edit] Please, take a look into my last commit who generated the Docker image issue - [fix: load dataset · leomaurodesenv/qasports-website at c5b95e6](https://huggingface.co/spaces/leomaurodesenv/qasports-website/commit/c5b95e6169760d495e9353c7694574484615d123)

---

<div class="post-metadata">

**Author:** ![leomaurodesenv](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/leomaurodesenv/32/50249_2.png) [@leomaurodesenv](https://discuss.huggingface.co/u/leomaurodesenv)\
**Post date:** [January 8, 2025, 11:56am UTC](https://discuss.huggingface.co/t/issue-with-huggingface-load-dataset/134809/4 "2025-01-08T11:56:57Z")

</div>

I just fixed. Step-by-step:

- Downgrade the Python from 3.10 to 3.9
- Fix Streamlit sdk version
- Update the requirements.txt with latest `datasets` and `huggingface_hub` libraries.

README.md

```auto
sdk: streamlit
sdk_version: 1.33.0
python_version: 3.9
app_file: app.py
...

```

requirements.txt

```auto
# HuggingFace
datasets==3.2.0
huggingface_hub==0.27.0

```

app.py

```auto
from datasets import load_dataset

dataset_name = "PedroCJardim/QASports"
dataset_split = "basketball"
dataset = load_dataset(dataset_name, name=dataset_split)

```

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/9/e/9e14b1f5a3f59d6b632e323d8e2855c1045fd313.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/hellohellohello/original/2X/d/de4155eb4aa4108ecb32a1389d7cc37ae69f88b7.png) [@system](https://discuss.huggingface.co/u/system)\
**Post date:** [January 8, 2025, 11:57pm UTC](https://discuss.huggingface.co/t/issue-with-huggingface-load-dataset/134809/5 "2025-01-08T23:57:49Z")

</div>

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