ModuleNotFoundError: No module named 'datasets'

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?

1 Like

@julien-c any solutions for this?

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

I resolved this issue by just installing datasets library.

!pip3 install datasets
2 Likes

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

pip3 install datasets
import datasets
from datasets import dataset_util