-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
error with cfgrib + eccodes #5150
Comments
We would need more information about your environments. Could you post the output of xr.tutorial.open_dataset("era5-2mt-2019-03-uk.grib", engine="cfgrib") |
I can try to reproduce the error and fix it, but I need to know at least the xarray version. |
Not sure if conda-forge/python-eccodes-feedstock#71 helps |
conda-error-output.txt Hi keewis and aurghs, as the working version with cfgrib 0.9.8.5 is already in production, it took some time to reproduce the previous environment from a backup. So here we are. Versions are: % conda list | egrep "(cfgrib|xarray|eccodes)" With "xr.tutorial.open_dataset("era5-2mt-2019-03-uk.grib", engine="cfgrib")" the result is the same, error message is: AttributeError: partially initialized module 'cfgrib' has no attribute 'open_file' (most likely due to a circular import) Full error output is attached. And I attached the output of "xr.show_versions()". I wonder why it shows "cfgrib: None"... Cheers, Olaf |
And I have to correct myself: Though I still have an output of xr_open_dataset from cfgrib version 0.9.8.5 that shows that it worked (otherwise I would doubt on my senses), it does not work right now. xr.show_versions shows "cfgrib: None", too. Also "import cfgrib" shows the same error. This sounds much like ecmwf/cfgrib#226 , but obviously I already use eccodes 2.21.0 (which is the proposed fix there...) |
I still can't reproduce this. For reference, here's my environment: output of xr.show_versions()
I can't seem to find that. Am I missing something?
I guess that's because the import fails. |
I added the missing attachments to my previous comment, seems that my browser did not cope with the upload mechanism.
Well, just to narrow down the error: I guess a working "import cfgrib" would be the precondition for it to work with xarray... (?) |
strange. This seems like a environment issue. Could you try creating a environment with contents of env.yml
With that, |
Strange. I deployed a completely new conda (using the miniforge installer Miniforge3-4.9.2-3-Linux-x86_64.sh). With that I created an environment "test" with your yml file. When I run the xr.tutorial.open_dataset (exact copy-paste from your message), I get the same error as usual: AttributeError: partially initialized module 'cfgrib' has no attribute 'open_file' (most likely due to a circular import What the heck can be the problem that I face? I am bemused... |
did you try Edit: also, did you make sure to activate the new environment (check |
Hi,
keewis wrote on 15.04.21 17:51:
did you try |mamba| or |conda| from |miniconda|?
right now I only did miniforge (though our elder
python environments are anaconda or conda). And:
Yes, the env was activated and no other xarray
or cfgrib stuff around here. :-)
When I create a complete new miniforge3-4.9.2-3
on our system and only do a
conda install eccodes
conda install cfgrib
the thing works. So there must be some relicts
from earlier package installs or some other
versions that cause the trouble. I got some
hints from a different site that it might even
be dependent on the order in which things are
installed, not sure about that. Still I wonder
that the error message seems to imply that
there might be a circular import...
I'll do some further testing and will come
back when I have something that is more
concrete so that you can look at it.
Thanks, Olaf
…--
Dipl. Inform. Olaf Gellert email ***@***.***
Deutsches Klimarechenzentrum GmbH phone +49 (0)40 460094 214
Bundesstrasse 45a fax +49 (0)40 460094 270
D-20146 Hamburg, Germany www http://www.dkrz.de
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Prof. Dr. Thomas Ludwig
Registergericht: Amtsgericht Hamburg, HRB 39784
|
Ok, PEBKAC (problem exists between keyboard and chair). Your hints already pointed in the correct direction, I had a testscript in my homedir which was named cfgrib.py, a very unfortunate naming, I'd say... Issue can be closed, everything is working fine. And many thanks for your efforts. Olaf |
Hi, I tried to install cfgrib and eccodes on two different conda installations. Installation is always successful. Right now I do have:
Importing xarray works, but whenever I do an "import cfgrib" or an "ds = xarray.open_dataset('gribfile.grb', engine='cfgrib')", I get:
(full error output attached). This happens on both conda installations (one is miniforge3-4.9.2.3, the other one is anaconda3 conda version 4.10).
Any idea what can cause this issue? FYI: I just downgraded cfgrib to 0.9.8.5 and now it works.
Cheers, Olaf
The text was updated successfully, but these errors were encountered: