ImportError: cannot import name 'list_datasets'
Author: hassani24
Pull request: no

I'm having an unusual issue on one computer and I'm hoping that someone out there has seen something like this before.  This issue does not exist on another computer.  Both computers are windows 10 machines, using python 3.6.4, virtualenv, and visual studio code as the ide

I have created a clean virtualenv and installed only datasets.  I get an import error when I try to import any of the built in functions, list_datasets, load_dataset, etc.

I have tried installing different versions of datasets and I have tried installing datasets from source instead of through pip with no success.  

Has anyone seen anything like this?  Any suggestions for something I can try to help debug? 

Here's the code:
import sys

```
print (sys.version)

from datasets import list_datasets

for i, ds in enumerate(list_datasets()):
  print (f"{i}: {ds}")
```

Here is the output:
3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)]
Traceback (most recent call last):
  File "c:\code\dataset_test\main.py", line 5, in <module>
    from datasets import list_datasets
ImportError: cannot import name 'list_datasets'

Here is the pip list:
Package            Version
------------------ ---------
certifi            2020.12.5
chardet            4.0.0
dataclasses        0.8
datasets           1.2.1
dill               0.3.3
idna               2.10
importlib-metadata 3.4.0
multiprocess       0.70.11.1
numpy              1.19.5
object-detection   0.1
pandas             1.1.5
pip                21.0.1
pyarrow            3.0.0
python-dateutil    2.8.1
pytz               2021.1
requests           2.25.1
setuptools         53.0.0
six                1.15.0
tqdm               4.49.0
typing-extensions  3.7.4.3
urllib3            1.26.3
wheel              0.36.2
xxhash             2.0.0
zipp               3.4.0

Comments:
Maybe @lhoestq can chime in here!

Hi ! It might come from a conflict. Somehow python is loading a bad `datasets` module. Can you check that you don't have a folder named "datasets" in your working directory or in a directory of you python path ?

Can you try to run this as well ?
```python
# if `datasets` points to the right `datasets` module, this should print the location of the module
print(datasets.__file__)
# if `datasets` points to a bad `datasets` module, this should print the location of the folder named "datasets"
print(datasets.__path__)
```

Thanks for the quick response.  I had something in my python path from a long time ago with a 'datasets' folder.  I was able to find it thanks to your suggestions (and learned something new :) ) so this problem is solved.

Same error, datasets version is 3.0.0
```
import datasets
print(datasets.__file__)
print(datasets.__path__)
from datasets import list_datasets
all_datasets  = list_datasets()
```
shows that interpreter uses correct datasets:
```
C:\Python310\lib\site-packages\datasets\__init__.py
['C:\\Python310\\lib\\site-packages\\datasets']
```
And error:
```
ImportError: cannot import name 'list_datasets' from 'datasets' (C:\Python310\lib\site-packages\datasets\__init__.py)
```

After I looked into source code, `list_datasets` does not exist. And there is only one hint in `load.py`, using huggingface_hub.list_datasets to see all data sets. So I guess this function no longer exist in 3.0.0 datasets. So using 
```
from huggingface_hub import list_datasets 
all_datasets = list_datasets()
```
to see all datasets. Or using j
```
from datasets import load_dataset
load_dataset(<name>)
```
to use one specific dataset

To resolve the error, simply import from the correct library:

```bash 
 from huggingface_hub import list_datasets

all_datasets = list(list_datasets()) # Convert generator to list

print(f"There are {len(all_datasets)} datasets currently available on the Hub.")
print("The first 10 are:", all_datasets[:10])