corteva / rioxarray

geospatial xarray extension powered by rasterio
https://corteva.github.io/rioxarray
Other
511 stars 81 forks source link

import error caused by old numpy version #587

Closed ghiggi closed 1 year ago

ghiggi commented 1 year ago

This error appears when importing rioxarray and is related to the numpy version.

I think you should constrain numpy to be > 1.21.6 (which solves the problem).

With numpy 1.21.3, importing rioxarray raise the following ImportError

ImportError: cannot import name 'NDArray' from 'numpy.typing' (/home/ghiggi/.conda/envs/satpy39/lib/python3.9/site-packages/numpy/typing/__init__.py)

Environment Information

snowman2 commented 1 year ago

Interesting, numpy says it was added in 1.21: https://numpy.org/devdocs/reference/typing.html#numpy.typing.NDArray

itcarroll commented 1 year ago

The latest build of rioxarray on conda forge (rioxarray-0.13.3-pyhd8ed1ab_1) now depends on numpy>1.21. I just installed numpy 1.21.0 and am able to import rioxarray without error. Is this still occurring for you @ghiggi?

@snowman2 Want a PR to add the dependency to setup.cfg for pip users as well?

snowman2 commented 1 year ago

Sure, a PR is welcome 👍