Required dependencies

  • Python 2.6, 2.7, 3.3, 3.4 or 3.5.
  • numpy (1.7 or later)
  • pandas (0.15.0 or later)

Optional dependencies

For netCDF and IO

  • netCDF4: recommended if you want to use xarray for reading or writing netCDF files
  • scipy: used as a fallback for reading/writing netCDF3
  • pydap: used as a fallback for accessing OPeNDAP
  • h5netcdf: an alternative library for reading and writing netCDF4 files that does not use the netCDF-C libraries

For accelerating xarray

  • bottleneck: speeds up NaN-skipping aggregations by a large factor
  • cyordereddict: speeds up most internal operations with xarray data structures

For parallel computing

For plotting


xarray itself is a pure Python package, but its dependencies are not. The easiest way to get them installed is to use conda. You can then install xarray with its recommended dependencies with the conda command line tool:

$ conda install xarray dask netCDF4 bottleneck

If you don’t use conda, be sure you have the required dependencies (numpy and pandas) installed first. Then, install xarray with pip:

$ pip install xarray

To run the test suite after installing xarray, install py.test and run py.test xarray.