Type error when importing datasets on Kaggle
NONE
I have the same problem 
It seems that it only appears when you are using GPU 
It seems to work fine with the 2.17 version though
2024-03-24T08:58:50Z
https://github.com/huggingface/datasets/issues/6753#issuecomment-2016740686
https://api.github.com/repos/huggingface/datasets/issues/6753
IC_kwDODunzps54NQVO
https://api.github.com/repos/huggingface/datasets/issues/comments/2016740686/reactions
2024-03-24T09:03:09Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2016740686
https://avatars.githubusercontent.com/u/125728220?v=4
https://api.github.com/users/Edgar454/events{/privacy}
https://api.github.com/users/Edgar454/followers
https://api.github.com/users/Edgar454/following{/other_user}
https://api.github.com/users/Edgar454/gists{/gist_id}
https://github.com/Edgar454
Edgar454
U_kgDOB3513A
https://api.github.com/users/Edgar454/orgs
https://api.github.com/users/Edgar454/received_events
https://api.github.com/users/Edgar454/repos
https://api.github.com/users/Edgar454/starred{/owner}{/repo}
https://api.github.com/users/Edgar454/subscriptions
User
https://api.github.com/users/Edgar454
public
NONE
Same here.
2024-03-27T00:55:30Z
https://github.com/huggingface/datasets/issues/6753#issuecomment-2021730063
https://api.github.com/repos/huggingface/datasets/issues/6753
IC_kwDODunzps54gScP
https://api.github.com/repos/huggingface/datasets/issues/comments/2021730063/reactions
2024-03-27T00:55:30Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2021730063
https://avatars.githubusercontent.com/u/50512341?v=4
https://api.github.com/users/RechieKho/events{/privacy}
https://api.github.com/users/RechieKho/followers
https://api.github.com/users/RechieKho/following{/other_user}
https://api.github.com/users/RechieKho/gists{/gist_id}
https://github.com/RechieKho
RechieKho
MDQ6VXNlcjUwNTEyMzQx
https://api.github.com/users/RechieKho/orgs
https://api.github.com/users/RechieKho/received_events
https://api.github.com/users/RechieKho/repos
https://api.github.com/users/RechieKho/starred{/owner}{/repo}
https://api.github.com/users/RechieKho/subscriptions
User
https://api.github.com/users/RechieKho
public
NONE
> I have the same problem
> It seems that it only appears when you are using GPU
> It seems to work fine with the 2.17 version though

I downgraded from 2.18 to 2.17, and it works with CPU/GPU .. except now pyarrow complains

```
...
File /opt/conda/lib/python3.10/site-packages/pyarrow/array.pxi:830, in pyarrow.lib._PandasConvertible.to_pandas()

File /opt/conda/lib/python3.10/site-packages/pyarrow/table.pxi:3989, in pyarrow.lib.Table._to_pandas()

ImportError: cannot import name table_to_blockmanager
```

see also https://www.kaggle.com/competitions/pii-detection-removal-from-educational-data/discussion/487474#2722594
2024-03-29T17:26:01Z
https://github.com/huggingface/datasets/issues/6753#issuecomment-2027522168
https://api.github.com/repos/huggingface/datasets/issues/6753
IC_kwDODunzps542Yh4
https://api.github.com/repos/huggingface/datasets/issues/comments/2027522168/reactions
2024-03-29T17:26:01Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2027522168
https://avatars.githubusercontent.com/u/2815031?v=4
https://api.github.com/users/msusol/events{/privacy}
https://api.github.com/users/msusol/followers
https://api.github.com/users/msusol/following{/other_user}
https://api.github.com/users/msusol/gists{/gist_id}
https://github.com/msusol
msusol
MDQ6VXNlcjI4MTUwMzE=
https://api.github.com/users/msusol/orgs
https://api.github.com/users/msusol/received_events
https://api.github.com/users/msusol/repos
https://api.github.com/users/msusol/starred{/owner}{/repo}
https://api.github.com/users/msusol/subscriptions
User
https://api.github.com/users/msusol
public
NONE
Solved for me by downgrading `!pip install -U datasets==2.16.0` Works with gpu aswell
2024-03-30T00:23:49Z
https://github.com/huggingface/datasets/issues/6753#issuecomment-2027841858
https://api.github.com/repos/huggingface/datasets/issues/6753
IC_kwDODunzps543mlC
https://api.github.com/repos/huggingface/datasets/issues/comments/2027841858/reactions
2024-03-30T00:23:49Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2027841858
https://avatars.githubusercontent.com/u/18300717?v=4
https://api.github.com/users/jtv199/events{/privacy}
https://api.github.com/users/jtv199/followers
https://api.github.com/users/jtv199/following{/other_user}
https://api.github.com/users/jtv199/gists{/gist_id}
https://github.com/jtv199
jtv199
MDQ6VXNlcjE4MzAwNzE3
https://api.github.com/users/jtv199/orgs
https://api.github.com/users/jtv199/received_events
https://api.github.com/users/jtv199/repos
https://api.github.com/users/jtv199/starred{/owner}{/repo}
https://api.github.com/users/jtv199/subscriptions
User
https://api.github.com/users/jtv199
public
NONE
I think you should remain open this issue. It works at the previous version but not the latter versions. It is possible as a bug that the maintainer could take note for.
2024-03-30T01:28:18Z
https://github.com/huggingface/datasets/issues/6753#issuecomment-2027861643
https://api.github.com/repos/huggingface/datasets/issues/6753
IC_kwDODunzps543raL
https://api.github.com/repos/huggingface/datasets/issues/comments/2027861643/reactions
2024-03-30T01:28:18Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2027861643
https://avatars.githubusercontent.com/u/50512341?v=4
https://api.github.com/users/RechieKho/events{/privacy}
https://api.github.com/users/RechieKho/followers
https://api.github.com/users/RechieKho/following{/other_user}
https://api.github.com/users/RechieKho/gists{/gist_id}
https://github.com/RechieKho
RechieKho
MDQ6VXNlcjUwNTEyMzQx
https://api.github.com/users/RechieKho/orgs
https://api.github.com/users/RechieKho/received_events
https://api.github.com/users/RechieKho/repos
https://api.github.com/users/RechieKho/starred{/owner}{/repo}
https://api.github.com/users/RechieKho/subscriptions
User
https://api.github.com/users/RechieKho
public
NONE
> Solved for me by downgrading `!pip install -U datasets==2.16.0` Works with gpu as well

Verified it's working w/ GPU if I make these 3 updates.

```
datasets==2.16.0
fsspec==2023.10.0
gcsfs==2023.10.0
```

but the issue shouldn't be closed, this is just a workaround until they get the issue with 2.18.0 resolved.

See also: https://www.kaggle.com/competitions/pii-detection-removal-from-educational-data/discussion/487474
2024-03-30T04:09:34Z
https://github.com/huggingface/datasets/issues/6753#issuecomment-2027906687
https://api.github.com/repos/huggingface/datasets/issues/6753
IC_kwDODunzps5432Z_
https://api.github.com/repos/huggingface/datasets/issues/comments/2027906687/reactions
2024-03-30T04:12:59Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2027906687
https://avatars.githubusercontent.com/u/2815031?v=4
https://api.github.com/users/msusol/events{/privacy}
https://api.github.com/users/msusol/followers
https://api.github.com/users/msusol/following{/other_user}
https://api.github.com/users/msusol/gists{/gist_id}
https://github.com/msusol
msusol
MDQ6VXNlcjI4MTUwMzE=
https://api.github.com/users/msusol/orgs
https://api.github.com/users/msusol/received_events
https://api.github.com/users/msusol/repos
https://api.github.com/users/msusol/starred{/owner}{/repo}
https://api.github.com/users/msusol/subscriptions
User
https://api.github.com/users/msusol
public
NONE
> > Solved for me by downgrading `!pip install -U datasets==2.16.0` Works with gpu as well
> 
> Verified it's working w/ GPU if I make these 3 updates.
> 
> ```
> datasets==2.16.0
> fsspec==2023.10.0
> gcsfs==2023.10.0
> ```
> 
> but the issue shouldn't be closed, this is just a workaround until they get the issue with 2.18.0 resolved.
> 
> See also: https://www.kaggle.com/competitions/pii-detection-removal-from-educational-data/discussion/487474

This also works for me, thanks
2024-04-04T13:50:23Z
https://github.com/huggingface/datasets/issues/6753#issuecomment-2037279565
https://api.github.com/repos/huggingface/datasets/issues/6753
IC_kwDODunzps55bmtN
https://api.github.com/repos/huggingface/datasets/issues/comments/2037279565/reactions
2024-04-04T13:50:35Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2037279565
https://avatars.githubusercontent.com/u/45648109?v=4
https://api.github.com/users/CQHofsns/events{/privacy}
https://api.github.com/users/CQHofsns/followers
https://api.github.com/users/CQHofsns/following{/other_user}
https://api.github.com/users/CQHofsns/gists{/gist_id}
https://github.com/CQHofsns
CQHofsns
MDQ6VXNlcjQ1NjQ4MTA5
https://api.github.com/users/CQHofsns/orgs
https://api.github.com/users/CQHofsns/received_events
https://api.github.com/users/CQHofsns/repos
https://api.github.com/users/CQHofsns/starred{/owner}{/repo}
https://api.github.com/users/CQHofsns/subscriptions
User
https://api.github.com/users/CQHofsns
public
NONE
I am seeing similar error but with pandas while using kaggle kernel. 
`---> 38 PANDAS_VERSION = version.parse(importlib.metadata.version("pandas"))
TypeError: expected string or bytes-like object

`
2024-10-02T11:49:34Z
https://github.com/huggingface/datasets/issues/6753#issuecomment-2388448905
https://api.github.com/repos/huggingface/datasets/issues/6753
IC_kwDODunzps6OXNaJ
https://api.github.com/repos/huggingface/datasets/issues/comments/2388448905/reactions
2024-10-02T11:49:34Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2388448905
https://avatars.githubusercontent.com/u/56831322?v=4
https://api.github.com/users/depshad/events{/privacy}
https://api.github.com/users/depshad/followers
https://api.github.com/users/depshad/following{/other_user}
https://api.github.com/users/depshad/gists{/gist_id}
https://github.com/depshad
depshad
MDQ6VXNlcjU2ODMxMzIy
https://api.github.com/users/depshad/orgs
https://api.github.com/users/depshad/received_events
https://api.github.com/users/depshad/repos
https://api.github.com/users/depshad/starred{/owner}{/repo}
https://api.github.com/users/depshad/subscriptions
User
https://api.github.com/users/depshad
public
### Describe the bug

When trying to run
```
import datasets
print(datasets.__version__)

```
It generates the following error

```
TypeError: expected string or bytes-like object
```

It looks like It cannot find the valid versions of `fsspec`

though fsspec version is fine when I checked Via command

```
import fsspec
print(fsspec.__version__)
​
# output: 2024.3.1
```

Detailed crash report
```
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[1], line 1
----> 1 import datasets
      2 print(datasets.__version__)

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.18.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:66
     63 from multiprocess import Pool
     64 from tqdm.contrib.concurrent import thread_map
---> 66 from . import config
     67 from .arrow_reader import ArrowReader
     68 from .arrow_writer import ArrowWriter, OptimizedTypedSequence

File /opt/conda/lib/python3.10/site-packages/datasets/config.py:41
     39 # Imports
     40 DILL_VERSION = version.parse(importlib.metadata.version("dill"))
---> 41 FSSPEC_VERSION = version.parse(importlib.metadata.version("fsspec"))
     42 PANDAS_VERSION = version.parse(importlib.metadata.version("pandas"))
     43 PYARROW_VERSION = version.parse(importlib.metadata.version("pyarrow"))

File /opt/conda/lib/python3.10/site-packages/packaging/version.py:49, in parse(version)
     43 """
     44 Parse the given version string and return either a :class:`Version` object
     45 or a :class:`LegacyVersion` object depending on if the given version is
     46 a valid PEP 440 version or a legacy version.
     47 """
     48 try:
---> 49     return Version(version)
     50 except InvalidVersion:
     51     return LegacyVersion(version)

File /opt/conda/lib/python3.10/site-packages/packaging/version.py:264, in Version.__init__(self, version)
    261 def __init__(self, version: str) -> None:
    262 
    263     # Validate the version and parse it into pieces
--> 264     match = self._regex.search(version)
    265     if not match:
    266         raise InvalidVersion(f"Invalid version: '{version}'")

TypeError: expected string or bytes-like object
```


### Steps to reproduce the bug

1. run `!pip install -U datasets` on kaggle
2. check datasets is installed via
```
import datasets
print(datasets.__version__)
```

### Expected behavior

Expected to print datasets version, like `2.18.0`

### Environment info

Running on Kaggle, latest enviornment , here is the notebook https://www.kaggle.com/code/jtv199/mistrial-7b-part2