You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rich is not a dependency of zarr but is required by zarr.Group.tree() function
The following code raises an exception (due to "import rich" in tree()) despite being minimal example:
Here is the full traceback:
root.tree()
Traceback (most recent call last):
File "/home/riveale/zarrvenv/lib64/python3.13/site-packages/zarr/core/_tree.py", line 9, in <module>
import rich
ModuleNotFoundError: No module named 'rich'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<python-input-2>", line 1, in <module>
root.tree()
~~~~~~~~~^^
File "/home/riveale/zarrvenv/lib64/python3.13/site-packages/zarr/core/group.py", line 2300, in tree
return self._sync(self._async_group.tree(expand=expand, level=level))
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/riveale/zarrvenv/lib64/python3.13/site-packages/zarr/core/sync.py", line 208, in _sync
return sync(
coroutine,
timeout=config.get("async.timeout"),
)
File "/home/riveale/zarrvenv/lib64/python3.13/site-packages/zarr/core/sync.py", line 163, in sync
raise return_result
File "/home/riveale/zarrvenv/lib64/python3.13/site-packages/zarr/core/sync.py", line 119, in _runner
return await coro
^^^^^^^^^^
File "/home/riveale/zarrvenv/lib64/python3.13/site-packages/zarr/core/group.py", line 1550, in tree
from zarr.core._tree import group_tree_async
File "/home/riveale/zarrvenv/lib64/python3.13/site-packages/zarr/core/_tree.py", line 13, in <module>
raise ImportError("'rich' is required for Group.tree") from e
ImportError: 'rich' is required for Group.tree
rich is an optional dependency, and you can install it with zarr with pip install zarr[optional], but this is not at all intuitive. we should probably come up with a better name for this, and update that import error
@d-v-b Hey I was just preparing a pull request and I noticed that it is in the [test] and [optional] in the .toml et cetera. Yea...not much to do about this if you don't want to pull it for normal installations. I don't know the right pythontic way to deal with this kind of thing.
Zarr version
3.0.6
Numcodecs version
0.15.1
Python Version
3.13
Operating System
Linux
Installation
pip install zarr
Description
rich is not a dependency of zarr but is required by zarr.Group.tree() function
The following code raises an exception (due to "import rich" in tree()) despite being minimal example:
Here is the full traceback:
Steps to reproduce
Additional output
No response
The text was updated successfully, but these errors were encountered: