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

import error caused by old numpy version #587

Closed
ghiggi opened this issue Oct 12, 2022 · 3 comments · Fixed by #636
Closed

import error caused by old numpy version #587

ghiggi opened this issue Oct 12, 2022 · 3 comments · Fixed by #636
Labels
installation-issues Issue related to installation problems.

Comments

@ghiggi
Copy link

ghiggi commented Oct 12, 2022

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

  • rioxarray version: 0.12.2
  • numpy: 1.21.3
@ghiggi ghiggi added the installation-issues Issue related to installation problems. label Oct 12, 2022
@snowman2
Copy link
Member

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

@itcarroll
Copy link
Contributor

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
Copy link
Member

Sure, a PR is welcome 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installation-issues Issue related to installation problems.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants