id,node_id,number,title,user,state,locked,assignee,milestone,comments,created_at,updated_at,closed_at,author_association,active_lock_reason,draft,pull_request,body,reactions,performed_via_github_app,state_reason,repo,type 1702025553,I_kwDOAMm_X85lctlR,7831,Can't open datasets with the `rasterio` engine.,13449576,open,0,,,7,2023-05-09T13:20:05Z,2023-06-21T19:39:46Z,,NONE,,,,"### What happened? Hello, When using this command: `data = xr.open_dataset(my_filename, engine=""rasterio"")` I get an error: `ValueError: unrecognized engine rasterio must be one of: ['netcdf4', 'scipy', 'store', 'zarr']` This error is generated because I don't have `rioxarray` installed. However, that's not clear from the message and the user is likely to assume that it's because they don't have `rasterio` installed. Would it be possible to improve this error message to allow the user to see that they require `rioxarray`? ### What did you expect to happen? An error message to be displayed that helps the user understand which package is missing. Something like: ``` ValueError: unrecognized engine rasterio must be one of: [engines]. The rasterio engine requires rioxarray to be installed. ``` ### Minimal Complete Verifiable Example ```Python To make a new conda env: conda create --name xrtesting conda activate xrtesting conda install xarray rasterio ``` Then, to generate the error: ``` import xarray as xr my_filename = 'test.tif' # This triggers the error even if the file is not present data = xr.open_dataset(my_filename, engine=""rasterio"") ``` ``` ### MVCE confirmation - [X] Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray. - [X] Complete example — the example is self-contained, including all data and the text of any traceback. - [X] Verifiable example — the example copy & pastes into an IPython prompt or [Binder notebook](https://mybinder.org/v2/gh/pydata/xarray/main?urlpath=lab/tree/doc/examples/blank_template.ipynb), returning the result. - [X] New issue — a search of GitHub Issues suggests this is not a duplicate. ### Relevant log output _No response_ ### Anything else we need to know? _No response_ ### Environment
INSTALLED VERSIONS ------------------ commit: None python: 3.11.3 | packaged by conda-forge | (main, Apr 6 2023, 08:57:19) [GCC 11.3.0] python-bits: 64 OS: Linux OS-release: 4.15.0-162-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: C.UTF-8 LOCALE: ('en_US', 'UTF-8') libhdf5: None libnetcdf: None xarray: 2023.4.2 pandas: 2.0.1 numpy: 1.24.3 scipy: None netCDF4: None pydap: None h5netcdf: None h5py: None Nio: None zarr: None cftime: None nc_time_axis: None PseudoNetCDF: None iris: None bottleneck: None dask: None distributed: None matplotlib: None cartopy: None seaborn: None numbagg: None fsspec: None cupy: None pint: None sparse: None flox: None numpy_groupies: None setuptools: 67.7.2 pip: 23.1.2 conda: None pytest: None mypy: None IPython: None sphinx: None
","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/7831/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,issue