Required dependencies

For plotting on geographical maps:

To open Natural Earth datasets (shapefiles):

Optional dependencies

To output xarray data sets:


regionmask itself is a pure Python package, but its dependencies are not. The easiest way to get them installed is to use conda.

conda install numpy cartopy xarray

If you don’t use conda, be sure you have the required dependencies. You can then install regionmask via pip (it is not (yet) available on conda):

pip install regionmask

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

To install the development version (master), do:

pip install git+