Skip to content

AttributeError with loading data with xarray on Google Colab #7149

Closed

Description

@ngohikennyyue

What is your issue?

The package xarray appear to not working since this morning. I have written some script that was utilizing xarray to load and interpolate netcdf data last night. But this morning when I went back to the same script and run it again it shows an attribute error
AttributeError: 'EntryPoints' object has no attribute 'get'
To make sure my data sources is not corrupted, I inspected and can open it with netcdf4 package smoothly without any hiccups.

I tried to open built in tutorial / sample dataset with xarray and it also appears with the same error message

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
[<ipython-input-1-daa755d2bb23>](https://localhost:8080/#) in <module>
      1 import xarray as xr
----> 2 xr.tutorial.load_dataset('air_temperature')

4 frames
[/usr/local/lib/python3.7/dist-packages/xarray/backends/plugins.py](https://localhost:8080/#) in list_engines()
    103 @functools.lru_cache(maxsize=1)
    104 def list_engines():
--> 105     entrypoints = entry_points().get("xarray.backends", ())
    106     return build_engines(entrypoints)
    107 

AttributeError: 'EntryPoints' object has no attribute 'get'

I'm using Google chrome to open Google Colab

The link to the error example
https://colab.research.google.com/drive/1OoT690jTQXtCvTAdpjUkpaKxvjcGO7vg?usp=sharing

https://gist.github.com/ngohikennyyue/dd32aa575be131f736b44d98b07212cd

Appreciate your time and attention.
Thanks

Activity

  1. added
    needs triage
    on Oct 9, 2022
  2. headtr1ck commented on Oct 9, 2022

    @headtr1ck
    Collaborator

    The problem seems to be importlib-metadata 5.0.0 which was released some days ago that deprecates the old entry point system.

    You could try to install version 4.* Of it and check if it works?

  3. added
    dependencies
    and removed
    needs triage
    on Oct 9, 2022
  4. keewis commented on Oct 9, 2022

    @keewis
    Collaborator

    otherwise you would probably have to upgrade your environment, we dropped support for python 3.7 some time ago

  5. ngohikennyyue commented on Oct 9, 2022

    @ngohikennyyue
    Author

    importlib-metadata

    @headtr1ck Thanks for the suggestions. After downgrading to the previous version and it seems to be working again. I guess at the moment we have to make sure the version of importlib-metadata package is not over 5.0.0 to have xarray run without any problem.
    @keewis Thanks for the solution.

  6. keewis commented on Oct 9, 2022

    @keewis
    Collaborator

    great, happy to hear that it works for you. Let's close this issue, then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependencies

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions