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

_fsspec_installed returns True when fsspec isn't installed #1407

Closed
yurivict opened this issue May 4, 2023 · 3 comments
Closed

_fsspec_installed returns True when fsspec isn't installed #1407

yurivict opened this issue May 4, 2023 · 3 comments
Labels
bug Potential issues with the zarr-python library

Comments

@yurivict
Copy link

yurivict commented May 4, 2023

Zarr version

2.14.2

Numcodecs version

0.11.0

Python Version

3.9

Operating System

FreeBSD 13.2

Installation

from port

Description

The function

def _fsspec_installed():
    """Returns true if fsspec is installed"""
    import importlib.util
                
    return importlib.util.find_spec("fsspec") is not None

returns True when fsspec isn't installed.

print(f"_fsspec_installed={_fsspec_installed()}")

Steps to reproduce

n/a

Additional output

No response

@yurivict yurivict added the bug Potential issues with the zarr-python library label May 4, 2023
@joshmoore
Copy link
Member

Hi @yurivict. Sorry to hear you're seeing odd behavior. If I do the following, I see False.

$ conda create -n z1407 zarr
$ conda activate z1407
$ python -c "import zarr.storage as zs; print(zs.FSStore._fsspec_installed())"
False

Is it possible, e.g., that fsspec is being pulled in somewhere else or that a module with that name exists somewhere on your PYTHONPATH?

@yurivict
Copy link
Author

yurivict commented May 4, 2023

Yes, there were some lost files left under /usr/local/lib/python3.9/site-packages/fsspec/ not belonging to any package.

This caused import fsspec to succeed.

Sorry for the noise!

@joshmoore
Copy link
Member

NP. Thanks for letting us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Potential issues with the zarr-python library
Projects
None yet
Development

No branches or pull requests

2 participants