# Dataset loading script test fails

**URL:** <https://discuss.huggingface.co/t/dataset-loading-script-test-fails/20847>\
**Category:** 🤗Datasets\
**Created:** [July 25, 2022, 4:00pm UTC](https://discuss.huggingface.co/t/dataset-loading-script-test-fails/20847 "2022-07-25T16:00:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aclifton314](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/aclifton314/32/55465_2.png) [@aclifton314](https://discuss.huggingface.co/u/aclifton314)\
**Post date:** [July 25, 2022, 4:00pm UTC](https://discuss.huggingface.co/t/dataset-loading-script-test-fails/20847/1 "2022-07-25T16:00:47Z")

</div>

Python: 3.9.7  
Datsets: 2.1.0

I’m trying to run the tests for my dataset loading script by following these instructions: [Create a dataset loading script](https://huggingface.co/docs/datasets/dataset_script#testing-data-and-checksum-metadata). When I run the following test:

```auto
RUN_SLOW=1 pytest tests/test_dataset_common.py::LocalDatasetTest::test_load_real_dataset_proto_data

```

I get the following error:

```python
============================================================================================ test session starts ============================================================================================
platform linux -- Python 3.9.7, pytest-7.1.1, pluggy-1.0.0
rootdir: /home/aclifton/datasets
plugins: anyio-3.5.0
collected 0 items / 1 error                                                                                                                                                                                 

================================================================================================== ERRORS ===================================================================================================
_______________________________________________________________________________ERROR collecting tests/test_dataset_common.py_______________________________________________________________________________
ImportError while importing test module '/home/aclifton/datasets/tests/test_dataset_common.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../anaconda3/envs/rffp/lib/python3.9/importlib/ __init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_dataset_common.py:27: in <module>
    from datasets.download.download_config import DownloadConfig
E ModuleNotFoundError: No module named 'datasets.download'
========================================================================================== short test summary info ==========================================================================================
ERROR tests/test_dataset_common.py
============================================================================================= 1 error in 0.09s ==============================================================================================
ERROR: not found: /home/aclifton/datasets/tests/test_dataset_common.py::LocalDatasetTest::test_load_real_dataset_proto_data
(no name '/home/aclifton/datasets/tests/test_dataset_common.py::LocalDatasetTest::test_load_real_dataset_proto_data' in any of [<Module test_dataset_common.py>])

```

despite having installed `datasets`. Does anyone have any suggestions about what I might be forgetting or doing wrong? Thanks in advance for your help!

---

<div class="post-metadata">

**Author:** ![lhoestq](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/lhoestq/32/52888_2.png) [@lhoestq](https://discuss.huggingface.co/u/lhoestq)\
**Post date:** [July 27, 2022, 9:23am UTC](https://discuss.huggingface.co/t/dataset-loading-script-test-fails/20847/2 "2022-07-27T09:23:25Z")

</div>

Hi ! You don’t need to use `pytest` anymore, the `datasets-cli test` command is enough 😉

We just updated the documentation to remove the part that mentions `pytest`

---

<div class="post-metadata">

**Author:** ![aclifton314](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/aclifton314/32/55465_2.png) [@aclifton314](https://discuss.huggingface.co/u/aclifton314)\
**Post date:** [July 27, 2022, 6:32pm UTC](https://discuss.huggingface.co/t/dataset-loading-script-test-fails/20847/3 "2022-07-27T18:32:19Z")

</div>

@lhoestq awesome, thank you for your response! Just to be clear, creating the dataset metadata and the dummy data using the `datasets-cli` commands, one can load the dataset using

```python
from datasets import load_dataset
load_dataset("/path/to/my_dataset")

```

I am in a position where I am not allowed to upload data to a hosted hub or server.

---

<div class="post-metadata">

**Author:** ![aclifton314](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/aclifton314/32/55465_2.png) [@aclifton314](https://discuss.huggingface.co/u/aclifton314)\
**Post date:** [July 29, 2022, 5:27pm UTC](https://discuss.huggingface.co/t/dataset-loading-script-test-fails/20847/4 "2022-07-29T17:27:28Z")

</div>

I checked if the above worked and it did. Thanks again @lhoestq for the guidance!!
