huggingface / datasets

🤗 The largest hub of ready-to-use datasets for ML models with fast, easy-to-use and efficient data manipulation tools
https://huggingface.co/docs/datasets
Apache License 2.0
19.24k stars 2.69k forks source link

Cannot import name 'maybe_sync' #3403

Closed KMFODA closed 2 years ago

KMFODA commented 2 years ago

Describe the bug

Cannot seem to import datasets when running run_summarizer.py script on a VM set up on ovhcloud

Steps to reproduce the bug

from datasets import load_dataset

Expected results

No error

Actual results

Traceback (most recent call last): File "", line 1, in File "/opt/conda/lib/python3.7/site-packages/datasets/init.py", line 34, in from .arrow_dataset import Dataset, concatenate_datasets File "/opt/conda/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 48, in from .arrow_writer import ArrowWriter, OptimizedTypedSequence File "/opt/conda/lib/python3.7/site-packages/datasets/arrow_writer.py", line 27, in from .features import ( File "/opt/conda/lib/python3.7/site-packages/datasets/features/init.py", line 2, in from .audio import Audio File "/opt/conda/lib/python3.7/site-packages/datasets/features/audio.py", line 8, in from ..utils.streaming_download_manager import xopen File "/opt/conda/lib/python3.7/site-packages/datasets/utils/streaming_download_manager.py", line 16, in from ..filesystems import COMPRESSION_FILESYSTEMS File "/opt/conda/lib/python3.7/site-packages/datasets/filesystems/init.py", line 13, in from .s3filesystem import S3FileSystem # noqa: F401 File "/opt/conda/lib/python3.7/site-packages/datasets/filesystems/s3filesystem.py", line 1, in import s3fs File "/opt/conda/lib/python3.7/site-packages/s3fs/init.py", line 1, in from .core import S3FileSystem, S3File File "/opt/conda/lib/python3.7/site-packages/s3fs/core.py", line 11, in from fsspec.asyn import AsyncFileSystem, sync, sync_wrapper, maybe_sync ImportError: cannot import name 'maybe_sync' from 'fsspec.asyn' (/opt/conda/lib/python3.7/site-packages/fsspec/asyn.py)

Environment info

lhoestq commented 2 years ago

Hi ! Can you try updating fsspec ? The minimum version is 2021.05.0

KMFODA commented 2 years ago

hey @lhoestq. I'm using fsspec-2021.11.1 but still getting that error.

lhoestq commented 2 years ago

Maybe this discussion can help:

https://github.com/fsspec/filesystem_spec/issues/597#issuecomment-958646964

KMFODA commented 2 years ago

Thanks @lhoestq. Downgrading fsspec and s3fs to 2021.10 fixed this issue!