-
Notifications
You must be signed in to change notification settings - Fork 48
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
ImportError: Regrid(filename) requires PIO and does not work if ESMF has not been built with MPI support #47
Comments
How did you get ESMPy? Simply |
I compiled ESMPy from ESMF 7.1 source code ( addon directory ). thanks, |
Could you see if |
I will try conda install and report here later. thanks |
Installation by conda solved the problem. Thanks. |
Great! |
Hi @JiaweiZhuang , I ran into this same issue / error message while trying to get a jupyter notebook to work with binder. I'm explicitly including The Binder is here (based on the repo https://github.com/ks905383/impact-variability): The relevant cell is in the master_run file notebook, in the code section "Preprocessing Historical Data"; Thank you! |
@ks905383 That's probably because you are mixing
See #54 (comment) and conda-forge/esmpy-feedstock#28 Also, does it work if you remove |
Hi Jiawei, Thanks for the quick reply. Unfortunately, this doesn't seem to be the issue (I had conda-forge listed first; I tried listing it as the only channel, without success. I tried a few other things unsuccessfully as well - removing mpi4py, putting esmf first as was suggested in one of the threads, etc.). |
FYI the only thing that worked for me was to force |
downgrading |
Same problem to me, just installed |
Would you be able to create a new conda environment? |
Just want to report that I ran into the same problem. I was unable to get xesmf (0.2.1) to work with esmpy=8.0.0. Creating a new conda environment with esmpy=7.1.0 and xesmf=0.2.1 seems to work. |
I also want to say that I ran into the same problem, and it was solved by going back to esmpy=7.1.0 and xesmf=0.2.1 It seems that MPI isn't installed with esmpy=8.0.0 and esmf=8.0.0, which might explain the error message ## Package Plan ##
environment location: /uio/kant/geo-metos-u1/shofer/.conda/envs/shofer
added / updated specs:
- esmpy=7.1.0
- xesmf=0.2.1
The following packages will be downloaded:
package | build
---------------------------|-----------------
mpich-3.3.2 | hc856adb_0 6.4 MB conda-forge
netcdf-fortran-4.4.5 | h0789656_1004 1.2 MB conda-forge
mpi-1.0 | mpich 4 KB conda-forge
esmf-7.1.0 | hcda5390_1008 23.7 MB conda-forge
esmpy-7.1.0 | py38h5ca1d4c_3 161 KB conda-forge
libnetcdf-4.6.2 | h303dfb8_1003 1.3 MB conda-forge
------------------------------------------------------------
Total: 32.7 MB
The following NEW packages will be INSTALLED:
mpi: 1.0-mpich conda-forge
mpich: 3.3.2-hc856adb_0 conda-forge
The following packages will be REMOVED:
netcdf4: 1.5.3-nompi_py38hd35fb8e_102 conda-forge
The following packages will be DOWNGRADED:
esmf: 8.0.0-nompi_he6d0a24_4 conda-forge --> 7.1.0-hcda5390_1008 conda-forge
esmpy: 8.0.0-nompi_py38hf0e99fa_1 conda-forge --> 7.1.0-py38h5ca1d4c_3 conda-forge
libnetcdf: 4.7.3-nompi_h9f9fd6a_101 conda-forge --> 4.6.2-h303dfb8_1003 conda-forge
netcdf-fortran: 4.5.2-nompi_h09cde99_103 conda-forge --> 4.4.5-h0789656_1004 conda-forge |
I went through the same issue but I actually was not satisfied with any of the previous solutions... because having
And fortunately, I succeeded to get MPI to install with esmpy last version, and the solution is simple:
If you install them together it doesn't work, if you install xesmf before it doesn't work. There is only by starting the installation of mpi 1.0 mpich conda-forge
mpi4py 3.0.3 py38hcf07815_0 conda-forge
mpich 3.3.2 hc856adb_0 conda-forge That way I have all the test that passed (https://xesmf.readthedocs.io/en/latest/installation.html#testing-your-installation): $ pip install pytest
$ pytest -v --pyargs xesmf # should all pass #################################################################### This solution will maybe not working for everyone and it is probably linked to this version and my environment. So here is my Miniconda installation method:
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
sh Miniconda3-latest-Linux-x86_64.sh
source ~/.bashrc
conda config --add channels conda-forge
conda config --set channel_priority strict
conda update -n base -c defaults conda The key is after to install Here is the # packages in environment at /data/mlalande/miniconda3/envs/test4:
#
# Name Version Build Channel
_libgcc_mutex 0.1 conda_forge conda-forge
_openmp_mutex 4.5 1_llvm conda-forge
attrs 19.3.0 pypi_0 pypi
bokeh 1.4.0 py38_0 conda-forge
bzip2 1.0.8 h516909a_2 conda-forge
ca-certificates 2019.11.28 hecc5488_0 conda-forge
certifi 2019.11.28 py38_0 conda-forge
click 7.0 py_0 conda-forge
cloudpickle 1.3.0 py_0 conda-forge
curl 7.68.0 hf8cf82a_0 conda-forge
cytoolz 0.10.1 py38h516909a_0 conda-forge
dask 2.11.0 py_0 conda-forge
dask-core 2.11.0 py_0 conda-forge
distributed 2.11.0 py38_0 conda-forge
esmf 8.0.0 mpi_mpich_h06e08bd_105 conda-forge
esmpy 8.0.0 mpi_mpich_py38ha9b28fa_101 conda-forge
freetype 2.10.0 he983fc9_1 conda-forge
fsspec 0.6.2 py_0 conda-forge
hdf4 4.2.13 hf30be14_1003 conda-forge
hdf5 1.10.5 mpi_mpich_ha7d0aea_1004 conda-forge
heapdict 1.0.1 py_0 conda-forge
jinja2 2.11.1 py_0 conda-forge
jpeg 9c h14c3975_1001 conda-forge
krb5 1.16.4 h2fd8d38_0 conda-forge
ld_impl_linux-64 2.33.1 h53a641e_8 conda-forge
libblas 3.8.0 15_openblas conda-forge
libcblas 3.8.0 15_openblas conda-forge
libcurl 7.68.0 hda55be3_0 conda-forge
libedit 3.1.20170329 hf8c457e_1001 conda-forge
libffi 3.2.1 he1b5a44_1006 conda-forge
libgcc-ng 9.2.0 h24d8f2e_2 conda-forge
libgfortran-ng 7.3.0 hdf63c60_5 conda-forge
liblapack 3.8.0 15_openblas conda-forge
libnetcdf 4.7.3 mpi_mpich_h755db7c_1 conda-forge
libopenblas 0.3.8 h5ec1e0e_0 conda-forge
libpng 1.6.37 hed695b0_0 conda-forge
libssh2 1.8.2 h22169c7_2 conda-forge
libstdcxx-ng 9.2.0 hdf63c60_2 conda-forge
libtiff 4.1.0 hc3755c2_3 conda-forge
llvm-openmp 9.0.1 hc9558a2_2 conda-forge
locket 0.2.0 py_2 conda-forge
lz4-c 1.8.3 he1b5a44_1001 conda-forge
markupsafe 1.1.1 py38h516909a_0 conda-forge
more-itertools 8.2.0 pypi_0 pypi
mpi 1.0 mpich conda-forge
mpi4py 3.0.3 py38hcf07815_0 conda-forge
mpich 3.3.2 hc856adb_0 conda-forge
msgpack-python 1.0.0 py38hc9558a2_0 conda-forge
ncurses 6.1 hf484d3e_1002 conda-forge
netcdf-fortran 4.5.2 mpi_mpich_hd560429_3 conda-forge
numpy 1.18.1 py38h95a1406_0 conda-forge
olefile 0.46 py_0 conda-forge
openssl 1.1.1d h516909a_0 conda-forge
packaging 20.1 py_0 conda-forge
pandas 1.0.1 py38hb3f55d8_0 conda-forge
partd 1.1.0 py_0 conda-forge
pillow 7.0.0 py38hefe7db6_0 conda-forge
pip 20.0.2 py_2 conda-forge
pluggy 0.13.1 pypi_0 pypi
psutil 5.7.0 py38h516909a_0 conda-forge
py 1.8.1 pypi_0 pypi
pyparsing 2.4.6 py_0 conda-forge
pytest 5.3.5 pypi_0 pypi
python 3.8.2 h9d8adfe_1_cpython conda-forge
python-dateutil 2.8.1 py_0 conda-forge
pytz 2019.3 py_0 conda-forge
pyyaml 5.3 py38h516909a_0 conda-forge
readline 8.0 hf8c457e_0 conda-forge
scipy 1.4.1 py38h921218d_0 conda-forge
setuptools 45.2.0 py38_0 conda-forge
six 1.14.0 py38_0 conda-forge
sortedcontainers 2.1.0 py_0 conda-forge
sqlite 3.30.1 hcee41ef_0 conda-forge
tblib 1.6.0 py_0 conda-forge
tk 8.6.10 hed695b0_0 conda-forge
toolz 0.10.0 py_0 conda-forge
tornado 6.0.3 py38h516909a_4 conda-forge
wcwidth 0.1.8 pypi_0 pypi
wheel 0.34.2 py_1 conda-forge
xarray 0.15.0 py_0 conda-forge
xesmf 0.2.2 py_0 conda-forge
xz 5.2.4 h14c3975_1001 conda-forge
yaml 0.2.2 h516909a_1 conda-forge
zict 2.0.0 py_0 conda-forge
zlib 1.2.11 h516909a_1006 conda-forge
zstd 1.4.4 h3b9ef0a_1 conda-forge |
I just wanted to confirm that @mickaellalande 's solution worked for me. But isn't there a way to fix this issue a bit more robustly? For me I'm running into the exact same problem, and there is no difference whether I'm trying it on an HPC cluster or my personal Linux PC. |
Does |
Actually it looks like the order is not important anymore, I've just made a new test thanks to the suggestion of @bradyrx with different .yml files:
name: xesmf_v0
channels:
- conda-forge
- defaults
dependencies:
- esmpy # 8.0.1
- xesmf # 0.3.0
- dask # 2.21.0
name: xesmf_v1
channels:
- conda-forge
- defaults
dependencies:
- python=3.7
- xesmf
- dask
- netCDF4 # not needed because already installed with dask I guess
name: xesmf_v2
channels:
- conda-forge
- defaults
dependencies:
- xesmf
- dask
- netCDF4 # not needed because already installed with dask I guess
name: xesmf_v3
channels:
- conda-forge
- defaults
dependencies:
- xesmf
- esmpy
- dask
I also tried back an installation directly with: No change in # packages in environment at /home/lalandmi/miniconda3/envs/xesmf_v0:
#
# Name Version Build Channel
mpi 1.0 mpich conda-forge
mpi4py 3.0.3 py38h4a80816_1 conda-forge
mpich 3.3.2 hc856adb_0 conda-forge The only change I see is Here are my environments details with different files formats ( Maybe a solution would be to add the mpi packages as an explicit dependence of xesmf so that it will automatically be installed @JiaweiZhuang? I have no idea how does it work... |
Specified xesmf version, added esmpy. Recent xesmf update buggy for regridding. See JiaweiZhuang/xESMF#47.
I was able to get this to work with help from another issue.
I used this yml as inspiration for what eventually worked for me, the important part being (not listing all the packages I use though):
Notes:
|
Pin xarray<=0.16.0
Hello, I installed successfully esmf_7_1_0r with ESMPy using option ESMF_COMM=mpiuni. However, I got the error "Regrid(filename) requires PIO and does not work if ESMF has not been built with MPI support" when I use xesmf "regridder = xe.Regridder(grid_in, grid_out, 'bilinear')". I wonder if the ESMF has to been compiled by MPI option?
The text was updated successfully, but these errors were encountered: