With a python 3.8 importing 'load' as from odc.stac import load generated this error:
Traceback (most recent call last):
File "download_sentinel.py", line 5, in <module>
from odc.stac import load as odc_load
File "/home/myuser/.local/lib/python3.8/site-packages/odc/stac/__init__.py", line 4, in <module>
from ._load import load
File "/home/myuser/.local/lib/python3.8/site-packages/odc/stac/_load.py", line 39, in <module>
from odc.geo.xr import xr_coords
File "/home/myuser/.local/lib/python3.8/site-packages/odc/geo/xr.py", line 15, in <module>
from ._xr_interop import (
File "/home/myuser/.local/lib/python3.8/site-packages/odc/geo/_xr_interop.py", line 54, in <module>
from .cog import to_cog, write_cog
File "/home/myuser/.local/lib/python3.8/site-packages/odc/geo/cog/__init__.py", line 1, in <module>
from ._rio import to_cog, write_cog, write_cog_layers
File "/home/myuser/.local/lib/python3.8/site-packages/odc/geo/cog/_rio.py", line 87, in <module>
xx: xr.DataArray | list[xr.DataArray],
TypeError: 'type' object is not subscriptable
Going into the file _rio.py I added from __future__ import annotations in the start and it solved this problem.
With a python 3.8 importing 'load' as
from odc.stac import load
generated this error:Going into the file _rio.py I added
from __future__ import annotations
in the start and it solved this problem.