xESMF: Installation through conda, import xesmf fails
Hello, I have installed xesmf through conda (I include the other libraries I used) :
conda create -n xesmf_env
conda activate xesmf_env
conda install -c conda-forge xesmf
conda install -c conda-forge dask netCDF4
conda install -c conda-forge matplotlib cartopy jupyterlab
And when I execute import xesmf, I get :
ERROR:
>>> import xesmf
Traceback (most recent call last):
File "C:\Users\adrie\miniconda3\envs\xesmf_env\lib\site-packages\esmpy\interface\loadESMF.py", line 26, in <module>
esmfmk = os.environ["ESMFMKFILE"]
File "C:\Users\adrie\miniconda3\envs\xesmf_env\lib\os.py", line 680, in __getitem__
raise KeyError(key) from None
KeyError: 'ESMFMKFILE'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\adrie\miniconda3\envs\xesmf_env\lib\site-packages\xesmf\backend.py", line 22, in <module>
import esmpy as ESMF
File "C:\Users\adrie\miniconda3\envs\xesmf_env\lib\site-packages\esmpy\__init__.py", line 112, in <module>
from esmpy.api.esmpymanager import *
File "C:\Users\adrie\miniconda3\envs\xesmf_env\lib\site-packages\esmpy\api\esmpymanager.py", line 9, in <module>
from esmpy.interface.cbindings import *
File "C:\Users\adrie\miniconda3\envs\xesmf_env\lib\site-packages\esmpy\interface\cbindings.py", line 13, in <module>
from esmpy.interface.loadESMF import _ESMF
File "C:\Users\adrie\miniconda3\envs\xesmf_env\lib\site-packages\esmpy\interface\loadESMF.py", line 28, in <module>
raise ImportError('The ESMFMKFILE environment variable is not available.')
ImportError: The ESMFMKFILE environment variable is not available.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\adrie\miniconda3\envs\xesmf_env\lib\site-packages\xesmf\__init__.py", line 4, in <module>
from .frontend import Regridder, SpatialAverager
File "C:\Users\adrie\miniconda3\envs\xesmf_env\lib\site-packages\xesmf\frontend.py", line 12, in <module>
from .backend import Grid, LocStream, Mesh, add_corner, esmf_regrid_build, esmf_regrid_finalize
File "C:\Users\adrie\miniconda3\envs\xesmf_env\lib\site-packages\xesmf\backend.py", line 24, in <module>
import ESMF
ModuleNotFoundError: No module named 'ESMF'
ERROR IMPORTING ESMF:
>>> import ESMF
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'ESMF'
This used to work a few months ago, the error appeared when I needed to use the library again since last week.
I tried to revert to an older version (0.6.3) and to install with pip, same issue. 2 other coworkers have tried and faced the same issue on their computer.
Thanks for any help!
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 16
Commits related to this issue
- downgrade version of esmf package to fix bug described in https://github.com/pangeo-data/xESMF/issues/246 — committed to dtcenter/METplus by georgemccabe 8 months ago
- downgrade version of esmf package to fix bug described in https://github.com/pangeo-data/xESMF/issues/246 — committed to dtcenter/METplus by georgemccabe 8 months ago
- Update develop-ref after dtcenter/MET#2732 (#2419) Co-authored-by: johnhg <johnhg@ucar.edu> Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com> Co-authored-by: Dan Adriaa... — committed to dtcenter/METplus by github-actions[bot] 8 months ago
- Update develop-ref after #2427 (#2434) Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com> Co-authored-by: Dan Adriaansen <dadriaan@ucar.edu> Co-authored-by: John Halley ... — committed to dtcenter/METplus by github-actions[bot] 7 months ago
- Update develop-ref after #2457 and #2453 (#2458) Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com> Co-authored-by: John Halley Gotway <johnhg@ucar.edu> Co-authored-by: ... — committed to dtcenter/METplus by github-actions[bot] 6 months ago
- Update develop-ref after #2488, #2480, and dtcenter/MET#2812 (#2490) * Update release guide to create the input test data directory for official MET releases. * Follow the METplus naming conventio... — committed to dtcenter/METplus by github-actions[bot] 5 months ago
- Update develop-ref after dtcenter/MET#2820 (#2502) * update versions to fix bugs for METplotpy/calcpy use cases * Bugfix #2026 develop StatAnalysis looping (#2028) * Feature #2022 update python... — committed to dtcenter/METplus by github-actions[bot] 5 months ago
- Update develop-ref after #2506 (#2512) * Feature 2065 v5.1.0 beta1 (#2066) * updated version number * added release notes * Update docs/Users_Guide/release-notes.rst Co-authored-by: John ... — committed to dtcenter/METplus by github-actions[bot] 4 months ago
- Update develop-ref after dtcenter/MET#2838 (#2519) * adding sphinx design to 3 files so dropdown menus will work in the release notes. * fix version numbers for python requirements for building do... — committed to dtcenter/METplus by github-actions[bot] 3 months ago
- Update develop-ref after dtcenter/MET#2840 (#2529) * Adding files for jet and hera * added commented process list that was accidentally removed -- this is used if the pre-processing steps are need... — committed to dtcenter/METplus by github-actions[bot] 3 months ago
hmm I wonder if the experience with activate/deactivate is different if installing from base environment or from within an environment? Beats me. But Kristen’s comment confirms your solution Pascal. Thank you both!
Thank goodness I found this! This wasn’t easily googleable for some reason but I found this by checking the issues directly.
Have you tried deactivating and re-activating the environment after the installation ?
Simply adding:
If this work, then it’s because you are encountering https://github.com/esmf-org/esmf/issues/117.
ESMF 8.4 had to major breaking changes:
esmpyDowngrading
esmfto 8.3.1 (and notxesmf) will also fix the issue.