# ModuleNotFoundError: No module named 'datasets'

**URL:** <https://discuss.huggingface.co/t/modulenotfounderror-no-module-named-datasets/21996>\
**Category:** 🤗Datasets\
**Created:** [August 23, 2022, 6:54pm UTC](https://discuss.huggingface.co/t/modulenotfounderror-no-module-named-datasets/21996 "2022-08-23T18:54:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rocket2008](https://avatars.discourse-cdn.com/v4/letter/r/7cd45c/32.png) [@Rocket2008](https://discuss.huggingface.co/u/Rocket2008)\
**Post date:** [August 23, 2022, 6:54pm UTC](https://discuss.huggingface.co/t/modulenotfounderror-no-module-named-datasets/21996/1 "2022-08-23T18:54:45Z")

</div>

My scripts run into the following error:

import datasets  
ModuleNotFoundError: No module named ‘datasets’

However, the datasets package is already installed (pip3 install datasets). Here is the info:  
$ pip3 freeze | grep datasets  
datasets==2.4.0

Could anyone provide some pointers on what’s wrong here?

---

<div class="post-metadata">

**Author:** ![anirudhmittal](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@anirudhmittal](https://discuss.huggingface.co/u/anirudhmittal)\
**Post date:** [March 14, 2023, 3:25am UTC](https://discuss.huggingface.co/t/modulenotfounderror-no-module-named-datasets/21996/2 "2023-03-14T03:25:02Z")

</div>

@julien-c any solutions for this?

---

<div class="post-metadata">

**Author:** ![prit-sk](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@prit-sk](https://discuss.huggingface.co/u/prit-sk)\
**Post date:** [March 14, 2023, 2:45pm UTC](https://discuss.huggingface.co/t/modulenotfounderror-no-module-named-datasets/21996/3 "2023-03-14T14:45:04Z")

</div>

this may be possibly because, the environment which you are operating on is different environment. and the datasets is installed on other environment. try checking using command for the pip path: !which pip

---

<div class="post-metadata">

**Author:** ![muhfaizan](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/muhfaizan/32/18059_2.png) [@muhfaizan](https://discuss.huggingface.co/u/muhfaizan)\
**Post date:** [May 14, 2023, 3:38pm UTC](https://discuss.huggingface.co/t/modulenotfounderror-no-module-named-datasets/21996/4 "2023-05-14T15:38:56Z")

</div>

I resolved this issue by just installing datasets library.

```auto
!pip3 install datasets

```

---

<div class="post-metadata">

**Author:** ![KayembaLuwaga](https://avatars.discourse-cdn.com/v4/letter/k/71e660/32.png) [@KayembaLuwaga](https://discuss.huggingface.co/u/KayembaLuwaga)\
**Post date:** [December 29, 2023, 4:12am UTC](https://discuss.huggingface.co/t/modulenotfounderror-no-module-named-datasets/21996/5 "2023-12-29T04:12:32Z")

</div>

> This worked for me (do not forget to use pip3 in ipython / Google colab), then first import the entire datasets lib

```auto
pip3 install datasets
import datasets
from datasets import dataset_util

```
