-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
AttributeError: module 'xarray' has no attribute 'open_rasterio' #8003
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
Comments
Thanks for opening your first issue here at xarray! Be sure to follow the issue template! |
Hi @tsnow03 , nice to see you! 👋 Xarray's What this means for users is that they should install In your case the offending However I'm surprised I can't find an issue about this there already - perhaps @scottyhq knows? |
Ok. Thank you @TomNicholas! I'll work on fixing this. |
intake-stac (which uses intake-xarray behind the scenes) development is somewhat stalled. The idea being that there are now tools to go directly from STAC catalogs to Xarray without needing intake as an intermediary. Check out these alternatives: @tsnow03 for a single asset like you've shown above here is an alternative: # Requires local credentials for USGS Landsat on AWS
os.environ["AWS_REQUEST_PAYER"] = "requester"
asset = items[0].assets['qa_pixel']
href = asset.extra_fields['alternate']['s3']['href']
band = xr.open_dataset(href, engine='rasterio', chunks=dict(band=1, x=512, y=512))
band |
Thanks @scottyhq for the code example! You saved me a lot of time. This will get updated in our JupyterBook too. |
Uh oh!
There was an error while loading. Please reload this page.
What happened?
Hello! An old version of xarray worked fine with my code, but after an accidental update to 2023.05.0, creates this AttributeError with xarray open_rasterio. Downgrading to xarray 2023.03.0 fixed the issue, but all versions after had the bug including 2023.07.0. It seems related to corteva/rioxarray/issues/254. Thanks for all of your help!
What did you expect to happen?
No response
Minimal Complete Verifiable Example
MVCE confirmation
Relevant log output
Anything else we need to know?
No response
Environment
INSTALLED VERSIONS
commit: None
python: 3.10.11 | packaged by conda-forge | (main, May 10 2023, 18:58:44) [GCC 11.3.0]
python-bits: 64
OS: Linux
OS-release: 5.10.167-147.601.amzn2.x86_64
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
LOCALE: ('en_US', 'UTF-8')
libhdf5: 1.14.0
libnetcdf: 4.9.2
xarray: 2023.5.0
pandas: 1.5.2
numpy: 1.23.5
scipy: 1.9.3
netCDF4: 1.6.4
pydap: None
h5netcdf: 1.1.0
h5py: 3.8.0
Nio: None
zarr: 2.15.0
cftime: 1.6.2
nc_time_axis: None
PseudoNetCDF: None
iris: None
bottleneck: None
dask: 2022.11.0
distributed: 2022.11.0
matplotlib: 3.6.2
cartopy: 0.21.1
seaborn: 0.12.1
numbagg: None
fsspec: 2022.11.0
cupy: None
pint: None
sparse: None
flox: None
numpy_groupies: None
setuptools: 67.7.2
pip: 22.3.1
conda: None
pytest: 7.2.0
mypy: None
IPython: 8.6.0
sphinx: 4.5.0
The text was updated successfully, but these errors were encountered: