Skip to content
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

importing the package #47

Closed
masawdah opened this issue Jul 20, 2023 · 4 comments
Closed

importing the package #47

masawdah opened this issue Jul 20, 2023 · 4 comments

Comments

@masawdah
Copy link

image
I encountered an error when trying to import xagg. Despite installing the ESMF package and following the installation instructions described in the readme file, I still faced difficulties. I also created an environment using the associated environment.yml file, but the issue persisted.

@ks905383
Copy link
Owner

Thanks for raising this issue. It appears the issue is in xesmf, with import ESMF / esmpy (as it's been renamed to recently).

For now, I found a fix here, to basically run:

export ESMFMKFILE=/path/to/anaconda3/envs/[envname]/lib/esmf.mk

before opening python. This works for me in a new environment.

xesmf is only used for a small part of the xagg functionality (regridding weights files to the input raster grid), so in the next version I'm going to limit loading xesmf to the part of the code that does that. If nothing else, it'll make sure the rest of the package isn't dragged down by the dependency issue...

@masawdah
Copy link
Author

masawdah commented Jul 21, 2023

Thank you so much. This worked great. Just to make sure that the ESMFMKFILE environment variable is available to the Jupyter Notebook session, run the following:
import os
os.environ['ESMFMKFILE'] = '/path/to/anaconda3/envs/[envname]/lib/esmf.mk'

@mjbludwig
Copy link

mjbludwig commented Nov 22, 2023

Not sure who maintains the conda forge stack but the default pulls down the old xagg 0.2.5 but the post module name changed and current version of esmpy 8.4.2. Meaning any xagg installs via conda-forge are broken out of the box. Looks like this may only be the case when using python 3.12 in your env though.

I was able to get a working conda env by specifically downgrading to python 3.11 and then specifying xagg==0.3.1

@ks905383
Copy link
Owner

Should be closed by #62 and implemented in v0.3.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants