AttributeError: module 'pyarrow.lib' has no attribute 'ListViewType'
MEMBER
Please note that the error is raised just at import:
```python
import pyarrow.parquet as pq
```

Therefore it must be caused by some problem with your pyarrow installation. I would recommend you uninstall and install pyarrow again.

I also see that it seems you use conda to install pyarrow. Please note that pyarrow offers 3 different packages in conda-forge: https://arrow.apache.org/docs/python/install.html#using-conda
```
conda install -c conda-forge pyarrow
```
> While the pyarrow [conda-forge](https://conda-forge.org/) package is the right choice for most users, both a minimal and maximal variant of the package exist, either of which may be better for your use case. See [Differences between conda-forge packages](https://arrow.apache.org/docs/python/install.html#python-conda-differences).

Please, make sure you install the right one: I guess it is either `pyarrow` (or `pyarrow-all`).
2024-06-19T13:40:19Z
https://github.com/huggingface/datasets/issues/6985#issuecomment-2178749547
https://api.github.com/repos/huggingface/datasets/issues/6985
IC_kwDODunzps6B3RRr
https://api.github.com/repos/huggingface/datasets/issues/comments/2178749547/reactions
2024-06-19T13:41:32Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2178749547
https://avatars.githubusercontent.com/u/8515462?v=4
https://api.github.com/users/albertvillanova/events{/privacy}
https://api.github.com/users/albertvillanova/followers
https://api.github.com/users/albertvillanova/following{/other_user}
https://api.github.com/users/albertvillanova/gists{/gist_id}
https://github.com/albertvillanova
albertvillanova
MDQ6VXNlcjg1MTU0NjI=
https://api.github.com/users/albertvillanova/orgs
https://api.github.com/users/albertvillanova/received_events
https://api.github.com/users/albertvillanova/repos
https://api.github.com/users/albertvillanova/starred{/owner}{/repo}
https://api.github.com/users/albertvillanova/subscriptions
User
https://api.github.com/users/albertvillanova
public
NONE
I have same issue, please downgrade pyarrow==15.0.2, it seem datasets library need to be fix
2024-06-25T02:39:55Z
https://github.com/huggingface/datasets/issues/6985#issuecomment-2187843310
https://api.github.com/repos/huggingface/datasets/issues/6985
IC_kwDODunzps6CZ9bu
https://api.github.com/repos/huggingface/datasets/issues/comments/2187843310/reactions
2024-06-25T02:39:55Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2187843310
https://avatars.githubusercontent.com/u/98505073?v=4
https://api.github.com/users/NicoNicoNico123/events{/privacy}
https://api.github.com/users/NicoNicoNico123/followers
https://api.github.com/users/NicoNicoNico123/following{/other_user}
https://api.github.com/users/NicoNicoNico123/gists{/gist_id}
https://github.com/NicoNicoNico123
NicoNicoNico123
U_kgDOBd8RcQ
https://api.github.com/users/NicoNicoNico123/orgs
https://api.github.com/users/NicoNicoNico123/received_events
https://api.github.com/users/NicoNicoNico123/repos
https://api.github.com/users/NicoNicoNico123/starred{/owner}{/repo}
https://api.github.com/users/NicoNicoNico123/subscriptions
User
https://api.github.com/users/NicoNicoNico123
public
MEMBER
It is not a problem with the `datasets` library: we support latest version of `pyarrow` and our Continuous Integration tests are using pyarrow 16.1.0 without any problem.

The error reported here is raised when importing pyarrow.parquet:
```
---> 29 import pyarrow.parquet as pq
```
```
File /opt/conda/lib/python3.10/site-packages/pyarrow/parquet/__init__.py:20
      1 # Licensed to the Apache Software Foundation (ASF) under one
      2 # or more contributor license agreements.  See the NOTICE file
      3 # distributed with this work for additional information
   (...)
     17 
     18 # flake8: noqa
---> 20 from .core import *

File /opt/conda/lib/python3.10/site-packages/pyarrow/parquet/core.py:33
     30 import pyarrow as pa
     32 try:
---> 33     import pyarrow._parquet as _parquet
     34 except ImportError as exc:
     35     raise ImportError(
     36         "The pyarrow installation is not built with support "
     37         f"for the Parquet file format ({str(exc)})"
     38     ) from None

File /opt/conda/lib/python3.10/site-packages/pyarrow/_parquet.pyx:1, in init pyarrow._parquet()

AttributeError: module 'pyarrow.lib' has no attribute 'ListViewType'
```

This can only be explained if pyarrow was not properly installed. 

If the user just installed `pyarrow-core` from conda-forge, then its parquet subpackage is not installed and cannot be imported. You can check pyarrow docs:
- Differences between conda-forge packages: https://arrow.apache.org/docs/python/install.html#python-conda-differences
> The `pyarrow-core` package includes the following functionality:
> ...
> The `pyarrow` package adds the following:
> ...
> Parquet (i.e., `pyarrow.parquet`)
2024-06-25T05:40:51Z
https://github.com/huggingface/datasets/issues/6985#issuecomment-2188022888
https://api.github.com/repos/huggingface/datasets/issues/6985
IC_kwDODunzps6CapRo
https://api.github.com/repos/huggingface/datasets/issues/comments/2188022888/reactions
2024-06-25T05:40:51Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2188022888
https://avatars.githubusercontent.com/u/8515462?v=4
https://api.github.com/users/albertvillanova/events{/privacy}
https://api.github.com/users/albertvillanova/followers
https://api.github.com/users/albertvillanova/following{/other_user}
https://api.github.com/users/albertvillanova/gists{/gist_id}
https://github.com/albertvillanova
albertvillanova
MDQ6VXNlcjg1MTU0NjI=
https://api.github.com/users/albertvillanova/orgs
https://api.github.com/users/albertvillanova/received_events
https://api.github.com/users/albertvillanova/repos
https://api.github.com/users/albertvillanova/starred{/owner}{/repo}
https://api.github.com/users/albertvillanova/subscriptions
User
https://api.github.com/users/albertvillanova
public
NONE
I'm still seeing the same issue on datasets version 2.20.0. I installed pyarrow version 17.0.0 with `pip install`. Downgrading to pyarrow==15.0.2 also did not resolve the issue.
2024-07-24T20:57:24Z
https://github.com/huggingface/datasets/issues/6985#issuecomment-2248885171
https://api.github.com/repos/huggingface/datasets/issues/6985
IC_kwDODunzps6GC0Oz
https://api.github.com/repos/huggingface/datasets/issues/comments/2248885171/reactions
2024-07-24T20:57:24Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2248885171
https://avatars.githubusercontent.com/u/12033704?v=4
https://api.github.com/users/RenaLu/events{/privacy}
https://api.github.com/users/RenaLu/followers
https://api.github.com/users/RenaLu/following{/other_user}
https://api.github.com/users/RenaLu/gists{/gist_id}
https://github.com/RenaLu
RenaLu
MDQ6VXNlcjEyMDMzNzA0
https://api.github.com/users/RenaLu/orgs
https://api.github.com/users/RenaLu/received_events
https://api.github.com/users/RenaLu/repos
https://api.github.com/users/RenaLu/starred{/owner}{/repo}
https://api.github.com/users/RenaLu/subscriptions
User
https://api.github.com/users/RenaLu
public
NONE
@RenaLu  As of UTC time 07/27/2024 23:20:00, I hit the same issue and reinstalling `pyarrow==15.0.2` resolved the issue for me. You may want to check if your `pyarrow` is successfully downgraded.
2024-07-27T23:21:38Z
https://github.com/huggingface/datasets/issues/6985#issuecomment-2254280124
https://api.github.com/repos/huggingface/datasets/issues/6985
IC_kwDODunzps6GXZW8
https://api.github.com/repos/huggingface/datasets/issues/comments/2254280124/reactions
2024-07-27T23:21:38Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2254280124
https://avatars.githubusercontent.com/u/22925031?v=4
https://api.github.com/users/chenmoneygithub/events{/privacy}
https://api.github.com/users/chenmoneygithub/followers
https://api.github.com/users/chenmoneygithub/following{/other_user}
https://api.github.com/users/chenmoneygithub/gists{/gist_id}
https://github.com/chenmoneygithub
chenmoneygithub
MDQ6VXNlcjIyOTI1MDMx
https://api.github.com/users/chenmoneygithub/orgs
https://api.github.com/users/chenmoneygithub/received_events
https://api.github.com/users/chenmoneygithub/repos
https://api.github.com/users/chenmoneygithub/starred{/owner}{/repo}
https://api.github.com/users/chenmoneygithub/subscriptions
User
https://api.github.com/users/chenmoneygithub
public
NONE
I can confirm @albertvillanova's [analysis & suggestion](https://github.com/huggingface/datasets/issues/6985#issuecomment-2188022888) - `pip uninstall pyarrow` followed by `pip install pyarrow` solved it for me. 

I suspect this is because pyarrow was initially installed as a pandas extra `pandas[...,parquet,...]`, then pip-upgrading pyarrow resulted in the issue.

@RenaLu did you uninstall pyarrow between changing versions?
2024-07-29T07:45:20Z
https://github.com/huggingface/datasets/issues/6985#issuecomment-2255235709
https://api.github.com/repos/huggingface/datasets/issues/6985
IC_kwDODunzps6GbCp9
https://api.github.com/repos/huggingface/datasets/issues/comments/2255235709/reactions
2024-07-29T07:45:20Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2255235709
https://avatars.githubusercontent.com/u/6509619?v=4
https://api.github.com/users/Dev-iL/events{/privacy}
https://api.github.com/users/Dev-iL/followers
https://api.github.com/users/Dev-iL/following{/other_user}
https://api.github.com/users/Dev-iL/gists{/gist_id}
https://github.com/Dev-iL
Dev-iL
MDQ6VXNlcjY1MDk2MTk=
https://api.github.com/users/Dev-iL/orgs
https://api.github.com/users/Dev-iL/received_events
https://api.github.com/users/Dev-iL/repos
https://api.github.com/users/Dev-iL/starred{/owner}{/repo}
https://api.github.com/users/Dev-iL/subscriptions
User
https://api.github.com/users/Dev-iL
public
NONE
After trying all the above combinations and failing, running the following in the notebook fixed the error!!
`!conda install -c conda-forge -y  datasets pyarrow libparquet`
Note : Uninstall any existing dataset and pyarrow installations in the env before executing the above.
2024-08-01T03:34:01Z
https://github.com/huggingface/datasets/issues/6985#issuecomment-2261895544
https://api.github.com/repos/huggingface/datasets/issues/6985
IC_kwDODunzps6G0cl4
https://api.github.com/repos/huggingface/datasets/issues/comments/2261895544/reactions
2024-08-01T03:35:02Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2261895544
https://avatars.githubusercontent.com/u/3713010?v=4
https://api.github.com/users/eminemence/events{/privacy}
https://api.github.com/users/eminemence/followers
https://api.github.com/users/eminemence/following{/other_user}
https://api.github.com/users/eminemence/gists{/gist_id}
https://github.com/eminemence
eminemence
MDQ6VXNlcjM3MTMwMTA=
https://api.github.com/users/eminemence/orgs
https://api.github.com/users/eminemence/received_events
https://api.github.com/users/eminemence/repos
https://api.github.com/users/eminemence/starred{/owner}{/repo}
https://api.github.com/users/eminemence/subscriptions
User
https://api.github.com/users/eminemence
public
NONE
If on colab, remember to restart the runtime so the new pyarrow is imported. I also upgraded pip which is recommended in pyarrow's installation instructions.
2024-08-19T20:20:25Z
https://github.com/huggingface/datasets/issues/6985#issuecomment-2297379502
https://api.github.com/repos/huggingface/datasets/issues/6985
IC_kwDODunzps6I7zqu
https://api.github.com/repos/huggingface/datasets/issues/comments/2297379502/reactions
2024-08-19T20:20:25Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2297379502
https://avatars.githubusercontent.com/u/279585?v=4
https://api.github.com/users/xloem/events{/privacy}
https://api.github.com/users/xloem/followers
https://api.github.com/users/xloem/following{/other_user}
https://api.github.com/users/xloem/gists{/gist_id}
https://github.com/xloem
xloem
MDQ6VXNlcjI3OTU4NQ==
https://api.github.com/users/xloem/orgs
https://api.github.com/users/xloem/received_events
https://api.github.com/users/xloem/repos
https://api.github.com/users/xloem/starred{/owner}{/repo}
https://api.github.com/users/xloem/subscriptions
User
https://api.github.com/users/xloem
public
NONE
fixed doing this: !pip install --upgrade datasets

!pip show pyarrow
!pip show datasets
!pip uninstall -y pyarrow
!pip install pyarrow --no-cache-dir
!pip install pyarrow
!pip install transformers
!pip install --upgrade datasets
!pip install datasets
! pip install pyarrow
! pip install pyarrow.parquet
!pip install transformers

# Import necessary libraries
from datasets import load_dataset
import pyarrow.parquet as pq
import pyarrow.lib as lib
import pandas as pd
from transformers import AutoTokenizer, AutoModelForSequenceClassification, Trainer, TrainingArguments

2024-08-20T08:22:49Z
https://github.com/huggingface/datasets/issues/6985#issuecomment-2298265757
https://api.github.com/repos/huggingface/datasets/issues/6985
IC_kwDODunzps6I_MCd
https://api.github.com/repos/huggingface/datasets/issues/comments/2298265757/reactions
2024-08-20T08:22:49Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2298265757
https://avatars.githubusercontent.com/u/175128880?v=4
https://api.github.com/users/neurafusionai/events{/privacy}
https://api.github.com/users/neurafusionai/followers
https://api.github.com/users/neurafusionai/following{/other_user}
https://api.github.com/users/neurafusionai/gists{/gist_id}
https://github.com/neurafusionai
neurafusionai
U_kgDOCnBBMA
https://api.github.com/users/neurafusionai/orgs
https://api.github.com/users/neurafusionai/received_events
https://api.github.com/users/neurafusionai/repos
https://api.github.com/users/neurafusionai/starred{/owner}{/repo}
https://api.github.com/users/neurafusionai/subscriptions
User
https://api.github.com/users/neurafusionai
public
NONE
but now i cant run test, so i remove it, ERROR: Could not find a version that satisfies the requirement pyarrow.parquet (from versions: none)
ERROR: No matching distribution found for pyarrow.parquet will still running but will tell you this
2024-08-20T08:23:55Z
https://github.com/huggingface/datasets/issues/6985#issuecomment-2298268288
https://api.github.com/repos/huggingface/datasets/issues/6985
IC_kwDODunzps6I_MqA
https://api.github.com/repos/huggingface/datasets/issues/comments/2298268288/reactions
2024-08-20T08:23:55Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2298268288
https://avatars.githubusercontent.com/u/175128880?v=4
https://api.github.com/users/neurafusionai/events{/privacy}
https://api.github.com/users/neurafusionai/followers
https://api.github.com/users/neurafusionai/following{/other_user}
https://api.github.com/users/neurafusionai/gists{/gist_id}
https://github.com/neurafusionai
neurafusionai
U_kgDOCnBBMA
https://api.github.com/users/neurafusionai/orgs
https://api.github.com/users/neurafusionai/received_events
https://api.github.com/users/neurafusionai/repos
https://api.github.com/users/neurafusionai/starred{/owner}{/repo}
https://api.github.com/users/neurafusionai/subscriptions
User
https://api.github.com/users/neurafusionai
public
NONE
I have the same question right now, python3.12 and transformers4.44.2, I have not fixed it
2024-11-04T08:07:55Z
https://github.com/huggingface/datasets/issues/6985#issuecomment-2454048085
https://api.github.com/repos/huggingface/datasets/issues/6985
IC_kwDODunzps6SRc1V
https://api.github.com/repos/huggingface/datasets/issues/comments/2454048085/reactions
2024-11-04T08:07:55Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2454048085
https://avatars.githubusercontent.com/u/92248118?v=4
https://api.github.com/users/Sherry-zsy/events{/privacy}
https://api.github.com/users/Sherry-zsy/followers
https://api.github.com/users/Sherry-zsy/following{/other_user}
https://api.github.com/users/Sherry-zsy/gists{/gist_id}
https://github.com/Sherry-zsy
Sherry-zsy
U_kgDOBX-YNg
https://api.github.com/users/Sherry-zsy/orgs
https://api.github.com/users/Sherry-zsy/received_events
https://api.github.com/users/Sherry-zsy/repos
https://api.github.com/users/Sherry-zsy/starred{/owner}{/repo}
https://api.github.com/users/Sherry-zsy/subscriptions
User
https://api.github.com/users/Sherry-zsy
public
NONE
I did most of the suggestions above and I still got the error, but after restarting my computer the error was fixed
2024-12-12T13:28:26Z
https://github.com/huggingface/datasets/issues/6985#issuecomment-2538923710
https://api.github.com/repos/huggingface/datasets/issues/6985
IC_kwDODunzps6XVOa-
https://api.github.com/repos/huggingface/datasets/issues/comments/2538923710/reactions
2024-12-12T13:28:26Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2538923710
https://avatars.githubusercontent.com/u/98906235?v=4
https://api.github.com/users/Poruton/events{/privacy}
https://api.github.com/users/Poruton/followers
https://api.github.com/users/Poruton/following{/other_user}
https://api.github.com/users/Poruton/gists{/gist_id}
https://github.com/Poruton
Poruton
U_kgDOBeUwew
https://api.github.com/users/Poruton/orgs
https://api.github.com/users/Poruton/received_events
https://api.github.com/users/Poruton/repos
https://api.github.com/users/Poruton/starred{/owner}{/repo}
https://api.github.com/users/Poruton/subscriptions
User
https://api.github.com/users/Poruton
public
NONE
how to fix this, still have this error. 
2025-02-11T12:05:57Z
https://github.com/huggingface/datasets/issues/6985#issuecomment-2650613587
https://api.github.com/repos/huggingface/datasets/issues/6985
IC_kwDODunzps6d_SdT
https://api.github.com/repos/huggingface/datasets/issues/comments/2650613587/reactions
2025-02-11T12:05:57Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2650613587
https://avatars.githubusercontent.com/u/25193686?v=4
https://api.github.com/users/LinXin04/events{/privacy}
https://api.github.com/users/LinXin04/followers
https://api.github.com/users/LinXin04/following{/other_user}
https://api.github.com/users/LinXin04/gists{/gist_id}
https://github.com/LinXin04
LinXin04
MDQ6VXNlcjI1MTkzNjg2
https://api.github.com/users/LinXin04/orgs
https://api.github.com/users/LinXin04/received_events
https://api.github.com/users/LinXin04/repos
https://api.github.com/users/LinXin04/starred{/owner}{/repo}
https://api.github.com/users/LinXin04/subscriptions
User
https://api.github.com/users/LinXin04
public
NONE
have we figured out what causes it?

2025-03-14T18:47:52Z
https://github.com/huggingface/datasets/issues/6985#issuecomment-2725498285
https://api.github.com/repos/huggingface/datasets/issues/6985
IC_kwDODunzps6ic82t
https://api.github.com/repos/huggingface/datasets/issues/comments/2725498285/reactions
2025-03-14T18:47:52Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2725498285
https://avatars.githubusercontent.com/u/13226395?v=4
https://api.github.com/users/gyori-andris/events{/privacy}
https://api.github.com/users/gyori-andris/followers
https://api.github.com/users/gyori-andris/following{/other_user}
https://api.github.com/users/gyori-andris/gists{/gist_id}
https://github.com/gyori-andris
gyori-andris
MDQ6VXNlcjEzMjI2Mzk1
https://api.github.com/users/gyori-andris/orgs
https://api.github.com/users/gyori-andris/received_events
https://api.github.com/users/gyori-andris/repos
https://api.github.com/users/gyori-andris/starred{/owner}{/repo}
https://api.github.com/users/gyori-andris/subscriptions
User
https://api.github.com/users/gyori-andris
public
### Describe the bug

I have been struggling with this for two days, any help would be appreciated. Python 3.10

```
from setfit import SetFitModel
from huggingface_hub import login

access_token_read = "cccxxxccc"

# Authenticate with the Hugging Face Hub
login(token=access_token_read)

# Load the models from the Hugging Face Hub
trainer_relv = SetFitModel.from_pretrained("snowdere/trainer_relevance")
trainer_trust = SetFitModel.from_pretrained("snowdere/trainer_trust")
trainer_sent = SetFitModel.from_pretrained("snowdere/trainer_sent")
trainer_topic = SetFitModel.from_pretrained("snowdere/trainer_topic")

```
```

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[6], line 1
----> 1 from setfit import SetFitModel
      2 from huggingface_hub import login
      4 access_token_read = "ccsddsds"

File /opt/conda/lib/python3.10/site-packages/setfit/__init__.py:7
      4 import os
      5 import warnings
----> 7 from .data import get_templated_dataset, sample_dataset
      8 from .model_card import SetFitModelCardData
      9 from .modeling import SetFitHead, SetFitModel

File /opt/conda/lib/python3.10/site-packages/setfit/data.py:5
      3 import pandas as pd
      4 import torch
----> 5 from datasets import Dataset, DatasetDict, load_dataset
      6 from torch.utils.data import Dataset as TorchDataset
      8 from . import logging

File /opt/conda/lib/python3.10/site-packages/datasets/__init__.py:18
      1 # ruff: noqa
      2 # Copyright 2020 The HuggingFace Datasets Authors and the TensorFlow Datasets Authors.
      3 #
   (...)
     13 # See the License for the specific language governing permissions and
     14 # limitations under the License.
     16 __version__ = "2.19.0"
---> 18 from .arrow_dataset import Dataset
     19 from .arrow_reader import ReadInstruction
     20 from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder

File /opt/conda/lib/python3.10/site-packages/datasets/arrow_dataset.py:76
     73 from tqdm.contrib.concurrent import thread_map
     75 from . import config
---> 76 from .arrow_reader import ArrowReader
     77 from .arrow_writer import ArrowWriter, OptimizedTypedSequence
     78 from .data_files import sanitize_patterns

File /opt/conda/lib/python3.10/site-packages/datasets/arrow_reader.py:29
     26 from typing import TYPE_CHECKING, List, Optional, Union
     28 import pyarrow as pa
---> 29 import pyarrow.parquet as pq
     30 from tqdm.contrib.concurrent import thread_map
     32 from .download.download_config import DownloadConfig

File /opt/conda/lib/python3.10/site-packages/pyarrow/parquet/__init__.py:20
      1 # Licensed to the Apache Software Foundation (ASF) under one
      2 # or more contributor license agreements.  See the NOTICE file
      3 # distributed with this work for additional information
   (...)
     17 
     18 # flake8: noqa
---> 20 from .core import *

File /opt/conda/lib/python3.10/site-packages/pyarrow/parquet/core.py:33
     30 import pyarrow as pa
     32 try:
---> 33     import pyarrow._parquet as _parquet
     34 except ImportError as exc:
     35     raise ImportError(
     36         "The pyarrow installation is not built with support "
     37         f"for the Parquet file format ({str(exc)})"
     38     ) from None

File /opt/conda/lib/python3.10/site-packages/pyarrow/_parquet.pyx:1, in init pyarrow._parquet()

AttributeError: module 'pyarrow.lib' has no attribute 'ListViewType'
```

setfit: 1.0.3
transformers: 4.41.2
lingua-language-detector: 2.0.2
polars: 0.20.31
lightning: None
google-cloud-bigquery: 3.24.0
shapely: 2.0.4
pyarrow: 16.0.0

### Steps to reproduce the bug

I have tried all version combinations for Dataset and Pyarrow, the all have the same error since a few days ago. This is accross multiple scripts I have. 

### Expected behavior

Just ron normally. 

### Environment info

3.10