Skip to content

async_wrapper protocol yields ModuleNotFoundError #1822

Open
@nils3er

Description

@nils3er

Trying to use the async_wrapper with url_to_fs to build an asynchronouos filesystem like:

fsspec.url_to_fs("async_wrapper://simplecache://https://www.foo.de")

It gives me a ModuleNotFoundError:

Traceback (most recent call last):
  File "/home/nils/projects/filesystem_spec/fsspec/registry.py", line 249, in get_filesystem_class
    register_implementation(protocol, _import_class(bit["class"]))
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nils/projects/filesystem_spec/fsspec/registry.py", line 284, in _import_class
    mod = importlib.import_module(mod)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1324, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'fsspec.asyn_wrapper'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/nils/projects/filesystem_spec/fsspec/core.py", line 403, in url_to_fs
    chain = _un_chain(url, kwargs)
            ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nils/projects/filesystem_spec/fsspec/core.py", line 351, in _un_chain
    cls = get_filesystem_class(protocol)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nils/projects/filesystem_spec/fsspec/registry.py", line 251, in get_filesystem_class
    raise ImportError(bit.get("err")) from e
ImportError: None

I tested with the up-to-date master branch (2025.3.2.post1+gaa1a301)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions