Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module 'resource' has no attribute 'error' #6308

Closed
NeoWang9999 opened this issue Oct 17, 2023 · 4 comments
Closed

module 'resource' has no attribute 'error' #6308

NeoWang9999 opened this issue Oct 17, 2023 · 4 comments

Comments

@NeoWang9999
Copy link

Describe the bug

just run import:
from datasets import load_dataset

and then:


  File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\__init__.py", line 22, in <module>
    from .arrow_dataset import Dataset
  File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\arrow_dataset.py", line 66, in <module>
    from .arrow_reader import ArrowReader
  File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\arrow_reader.py", line 30, in <module>
    from .download.download_config import DownloadConfig
  File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\download\__init__.py", line 10, in <module>
    from .streaming_download_manager import StreamingDownloadManager
  File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\download\streaming_download_manager.py", line 21, in <module>
    from ..filesystems import COMPRESSION_FILESYSTEMS
  File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\filesystems\__init__.py", line 8, in <module>
    import fsspec.asyn
  File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\fsspec\asyn.py", line 157, in <module>
    ResourceEror = resource.error
AttributeError: module 'resource' has no attribute 'error'

Process finished with exit code 1

and the error codes are:

try:
    import resource
except ImportError:
    resource = None
    ResourceError = OSError
else:
    ResourceEror = resource.error

  1. miss spelling : "ResourceEror " should be "ResourceErorr"
  2. module 'resource' has no attribute 'error'

Steps to reproduce the bug

only one step:

from datasets import load_dataset

Expected behavior

slove error: module 'resource' has no attribute 'error'

Environment info

python=3.10

datasets==2.14.5

@mariosasko
Copy link
Collaborator

mariosasko commented Oct 17, 2023

This (Windows) issue was fixed in fsspec in fsspec/filesystem_spec#1275. So, to avoid the error, update the fsspec installation with pip install -U fsspec.

@NeoWang9999
Copy link
Author

This (Windows) issue was fixed in fsspec in fsspec/filesystem_spec#1275. So, to avoid the error, update the fsspec installation with pip install -U fsspec.

after I run pip install -U fsspec

it occurs a new error:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflict
s.
datasets 2.14.5 requires fsspec[http]<2023.9.0,>=2023.1.0, but you have fsspec 2023.9.2 which is incompatible.

@mariosasko
Copy link
Collaborator

The fsspec<2023.9.0 upper bound will be removed in the next release. The ResourceError fix is also present in version 2023.6.0, so use that version in the meantime (pip install fsspec==2023.6.0).

@NeoWang9999
Copy link
Author

The fsspec<2023.9.0 upper bound will be removed in the next release. The ResourceError fix is also present in version 2023.6.0, so use that version in the meantime (pip install fsspec==2023.6.0).

thanks for reply!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants