I am trying to import datasets. I have already installed with pip and I am still getting this error. I am running this code on Domino which should be a controlled environment. Is there something I need to do to adjust the environment?
pip install datasets --upgrade
pip install datasets --userError I'm getting:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[21], line 1
----> 1 from datasets import Dataset 2 train_dataset = Dataset.from_dict({"question": list(train_q), "label": train_label}) 3 train_dataset
File ~/.local/lib/python3.9/site-packages/datasets/__init__.py:22 1 # flake8: noqa 2 # Copyright 2020 The HuggingFace Datasets Authors and the TensorFlow Datasets Authors. 3 # (...) 17 # pylint: enable=line-too-long 18 # pylint: disable=g-import-not-at-top,g-bad-import-order,wrong-import-position 20 __version__ = "2.14.4"
---> 22 from .arrow_dataset import Dataset 23 from .arrow_reader import ReadInstruction 24 from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder
File ~/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py:66 63 from requests import HTTPError 65 from . import config
---> 66 from .arrow_reader import ArrowReader 67 from .arrow_writer import ArrowWriter, OptimizedTypedSequence 68 from .data_files import sanitize_patterns
File ~/.local/lib/python3.9/site-packages/datasets/arrow_reader.py:34 32 from .table import InMemoryTable, MemoryMappedTable, Table, concat_tables 33 from .utils import logging
---> 34 from .utils.file_utils import cached_path 37 if TYPE_CHECKING: 38 from .info import DatasetInfo # noqa: F401
File ~/.local/lib/python3.9/site-packages/datasets/utils/file_utils.py:348 344 raise ValueError(f"HEAD can be called with at most one path but was called with {paths}") 345 return fs.info(paths[0])
--> 348 class TqdmCallback(fsspec.callbacks.TqdmCallback): 349 def __init__(self, tqdm_kwargs=None, *args, **kwargs): 350 super().__init__(tqdm_kwargs, *args, **kwargs)
AttributeError: module 'fsspec.callbacks' has no attribute 'TqdmCallback' 1 Answer
Upgrading worked for me. !pip install --upgrade fsspec