TUW-GEO / ismn

Readers for the data from the International Soil Moisture Network
https://ismn.earth/en/
MIT License
31 stars 21 forks source link

can not import name 'xr' from 'ismn.const' in ismn-1.5.0 #89

Closed Dushuai12138 closed 3 weeks ago

Dushuai12138 commented 3 weeks ago

I installed ismn-1.5.0, ran from ismn.interface import ISMN_Interface and got bug

......
36 from ismn.const import xarray_available, xr      
38 import json     
41 class IsmnComponent:  
ImportError: cannot import name 'xr' from 'ismn.const'(E:\ProgramData\Anaconda3\envs\gee1\Lib\site-packages\ismn\const.py)

I uninstalled ismn-1.5.0 and installed ismn-1.4.0, this error disapeared.

wpreimes commented 3 weeks ago

Thanks for reporting and sorry for the issue. xarray should be optional, but right now it is required it seems. I will fix this immediately, in the meantime, as a workaround for v1.5, you can install xarray (e.g conda install xarray dask), see also https://github.com/TUW-GEO/ismn?tab=readme-ov-file#optional-dependencies. Or as noted fall back to version 1.4

wpreimes commented 3 weeks ago

I have just released v1.5.1 which should fix this issue.

Dushuai12138 commented 2 weeks ago

I have just released v1.5.1 which should fix this issue.

yeah, it works. Thanks.