Regridding error while using xESMF (MPI module missing)

Hi everyone,

I’m working on Pangeo Cloud ( to analyze some CMIP6 outputs. I used python package xESMF to regrid the data from different models and I got the following error:

ImportError: Regrid(filename) requires PIO and does not work if ESMF has not been built with MPI support

I think this error is the same as this issue, so I listed all packages in the current environment and I couldn’t find the MPI module. I tried to solve this problem by going back to esmpy=7.1.0 (which is suggested in the above issue) but I failed. conda install esmpy=7.1.0 doesn’t work on Pangeo Cloud.

I was wondering if there is any solution for this.

Here is a reproducible example:

import xarray as xr
import xesmf as xe
import numpy as np

ds = xr.tutorial.open_dataset('air_temperature') 
ds_out = xr.Dataset({'lat': (['lat'], np.arange(16, 75, 1.0)),
                     'lon': (['lon'], np.arange(200, 330, 1.5)),

regridder = xe.Regridder(ds, ds_out, 'bilinear')

Thank you!

1 Like

Hmmm that’s not good. We definitely need xesmf in the environment. In practice, to update the environment, we need to make a change in a github repo. I have opened an issue for you:

I think we need to start pointing people directly to that issue tracker for environment questions.