home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 1352920776

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
1352920776 I_kwDOAMm_X85Qo-7I 6960 Unable to import xarray after installing "io" extras in Python 3.10.* 4753005 closed 0     3 2022-08-27T02:50:48Z 2022-09-01T10:15:30Z 2022-09-01T10:15:30Z NONE      

What happened?

When installed into a Python 3.10 environment with a basic pip install xarray, there are no issues importing xarray. But when installing with pip install xarray[io], the following error results upon import: ``` Python 3.10.6 | packaged by conda-forge | (main, Aug 22 2022, 20:36:39) [GCC 10.4.0] on linux Type "help", "copyright", "credits" or "license" for more information.

import xarray as xr Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/gfindlay/miniconda3/envs/foo/lib/python3.10/site-packages/xarray/init.py", line 1, in <module> from . import testing, tutorial File "/home/gfindlay/miniconda3/envs/foo/lib/python3.10/site-packages/xarray/tutorial.py", line 13, in <module> from .backends.api import open_dataset as open_dataset File "/home/gfindlay/miniconda3/envs/foo/lib/python3.10/site-packages/xarray/backends/__init__.py", line 14, in <module> from .pydap import PydapDataStore File "/home/gfindlay/miniconda3/envs/foo/lib/python3.10/site-packages/xarray/backends/pydap_.py", line 20, in <module> import pydap.client File "/home/gfindlay/miniconda3/envs/foo/lib/python3.10/site-packages/pydap/client.py", line 50, in <module> from .model import DapType File "/home/gfindlay/miniconda3/envs/foo/lib/python3.10/site-packages/pydap/model.py", line 175, in <module> from collections import OrderedDict, Mapping ImportError: cannot import name 'Mapping' from 'collections' (/home/gfindlay/miniconda3/envs/foo/lib/python3.10/collections/init.py) `` It appears that having the extras installed causes an alternate series of imports within xarray that have not been updated for Python 3.10 (from collections import Mappingshould befrom collections.abc import Mapping`).

What did you expect to happen?

No response

Minimal Complete Verifiable Example

```Python

mamba create -n foo python=3 mamba activate foo pip install xarray[io] python

import xarray as xr ```

MVCE confirmation

  • [X] Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray.
  • [X] Complete example — the example is self-contained, including all data and the text of any traceback.
  • [X] Verifiable example — the example copy & pastes into an IPython prompt or Binder notebook, returning the result.
  • [X] New issue — a search of GitHub Issues suggests this is not a duplicate.

Relevant log output

No response

Anything else we need to know?

No response

Environment

N/A
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/6960/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 2 rows from issues_id in issues_labels
  • 3 rows from issue in issue_comments
Powered by Datasette · Queries took 0.597ms · About: xarray-datasette