home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

12 rows where issue = 1019478260 sorted by updated_at descending

✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date)

user 3

  • keewis 5
  • twhughes 4
  • ashwinvis 3

author_association 3

  • MEMBER 5
  • NONE 4
  • CONTRIBUTOR 3

issue 1

  • Dask error when importing pip installed xarray. · 12 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
985473412 https://github.com/pydata/xarray/issues/5841#issuecomment-985473412 https://api.github.com/repos/pydata/xarray/issues/5841 IC_kwDOAMm_X846vSGE ashwinvis 9155111 2021-12-03T12:17:51Z 2021-12-03T12:33:59Z CONTRIBUTOR

See also #5236 which could be related which uses conda.

I tried to scour through pip and pytest issues, but I can't find a discussion on this. pip and pytest and pycacheare too generic keywords. I even found pytest plugin to remove bytecode but it does not work ~~anymore~~ for me.

I proposed a fix in #6039, which I believe is good to have, as you can't expect every user to execute with python -B or set PYTHONDONTWRITEBYTECODE while running tests.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Dask error when importing pip installed xarray. 1019478260
985413409 https://github.com/pydata/xarray/issues/5841#issuecomment-985413409 https://api.github.com/repos/pydata/xarray/issues/5841 IC_kwDOAMm_X846vDch keewis 14808389 2021-12-03T10:42:34Z 2021-12-03T10:42:34Z MEMBER

I don't think xarray has anything to do with that issue: if python -c 'import dask' succeeds, xarray will have to assume dask is available.

You will probably have to investigate pip (why didn't it remove the __pycache__ directory?) or pytest (why was the pyc file created in the first place?) to really fix this, but for now you can try setting PYTHONDONTWRITEBYTECODE or running python with -B (for example, python -B -m pytest)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Dask error when importing pip installed xarray. 1019478260
985386101 https://github.com/pydata/xarray/issues/5841#issuecomment-985386101 https://api.github.com/repos/pydata/xarray/issues/5841 IC_kwDOAMm_X846u8x1 ashwinvis 9155111 2021-12-03T10:02:51Z 2021-12-03T10:02:51Z CONTRIBUTOR

This in my opinion is a cascade of multiple issues: - pytest creates special bytecode - pip does not clean the whole __pycache__ directory on uninstall - xarray.pycompat.is_duck_dask_array uses importlib.import_module('dask') to determine if it is installed.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Dask error when importing pip installed xarray. 1019478260
985379668 https://github.com/pydata/xarray/issues/5841#issuecomment-985379668 https://api.github.com/repos/pydata/xarray/issues/5841 IC_kwDOAMm_X846u7NU ashwinvis 9155111 2021-12-03T09:53:46Z 2021-12-03T09:53:46Z CONTRIBUTOR

@twhughes @keewis In my case, I encounter this when I: - Have xarray + dask installed in my environment - Run any pytest which imports xarray (which in turn imports dask) - Uninstall dask, but pytest artefacts remain:

sh ❯ ls venv/lib/python3.9/site-packages/dask/__pycache__ utils_test.cpython-39-pytest-6.2.5.pyc

Here are the steps which would hopefully reproduce the behaviour:

```py

Create this small unit test named:

test_import_xarray.py

def test_xr(): import xarray ```

```sh python -m venv venv source venv/bin/activate pip install xarray pytest dask pytest test_import_xarray.py

pip uninstall dask ls venv/lib/python3.9/site-packages/dask/pycache # See output above python -c 'import dask' # No ImportError! python -c 'import xarray' ```

Exact versions used Python 3.9.9 along with: ```sh

requirements.txt

attrs==21.2.0 cloudpickle==2.0.0 dask==2021.11.2 fsspec==2021.11.1 iniconfig==1.1.1 locket==0.2.1 numpy==1.21.4 packaging==21.3 pandas==1.3.4 partd==1.2.0 pluggy==1.0.0 py==1.11.0 pyparsing==3.0.6 pytest==6.2.5 python-dateutil==2.8.2 pytz==2021.3 PyYAML==6.0 six==1.16.0 toml==0.10.2 toolz==0.11.2 xarray==0.20.1 ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Dask error when importing pip installed xarray. 1019478260
945186522 https://github.com/pydata/xarray/issues/5841#issuecomment-945186522 https://api.github.com/repos/pydata/xarray/issues/5841 IC_kwDOAMm_X844Vmba twhughes 5669557 2021-10-17T20:05:45Z 2021-10-17T20:05:45Z NONE

Hm, ok this seems to pass for me as well. I will have to look into it a bit more, thanks for your advice.

On Sun, Oct 17, 2021 at 9:50 AM keewis @.***> wrote:

I still can't reproduce if I create the environment using

python3.9 -m venv testsource test/bin/activate python -m pip install xarray python -c 'import xarray'

Looking at the traceback you posted it seems you've been trying to install into /usr/local/lib/python3.9? That's something you should avoid as much as possible, unless you're trying to build OS packages.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/pydata/xarray/issues/5841#issuecomment-945157584, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLIFNN7CAM67VLNVI7MN2DUHL5ERANCNFSM5FQBFPTQ .

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Dask error when importing pip installed xarray. 1019478260
945157584 https://github.com/pydata/xarray/issues/5841#issuecomment-945157584 https://api.github.com/repos/pydata/xarray/issues/5841 IC_kwDOAMm_X844VfXQ keewis 14808389 2021-10-17T16:50:05Z 2021-10-17T16:50:38Z MEMBER

I still can't reproduce if I create the environment using sh python3.9 -m venv test source test/bin/activate python -m pip install xarray python -c 'import xarray'

Looking at the traceback you posted it seems you've been trying to install into /usr/local? That's something you should avoid as much as possible (unless you're trying to build OS packages).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Dask error when importing pip installed xarray. 1019478260
945153975 https://github.com/pydata/xarray/issues/5841#issuecomment-945153975 https://api.github.com/repos/pydata/xarray/issues/5841 IC_kwDOAMm_X844Vee3 twhughes 5669557 2021-10-17T16:26:03Z 2021-10-17T16:26:03Z NONE

Thanks. Note I am using venv(not conda) on python 3.9.
So after creation of a clean environment and then pip install xarray I needed pip install dask to not see this error.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Dask error when importing pip installed xarray. 1019478260
945112226 https://github.com/pydata/xarray/issues/5841#issuecomment-945112226 https://api.github.com/repos/pydata/xarray/issues/5841 IC_kwDOAMm_X844VUSi keewis 14808389 2021-10-17T12:43:58Z 2021-10-17T12:43:58Z MEMBER

closing as a environment issue, but feel free to ask if you need more help

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Dask error when importing pip installed xarray. 1019478260
939267151 https://github.com/pydata/xarray/issues/5841#issuecomment-939267151 https://api.github.com/repos/pydata/xarray/issues/5841 IC_kwDOAMm_X843_BRP keewis 14808389 2021-10-09T09:45:00Z 2021-10-09T09:46:13Z MEMBER

I don't think there is, unfortunately

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Dask error when importing pip installed xarray. 1019478260
937808678 https://github.com/pydata/xarray/issues/5841#issuecomment-937808678 https://api.github.com/repos/pydata/xarray/issues/5841 IC_kwDOAMm_X8435dMm twhughes 5669557 2021-10-07T13:45:55Z 2021-10-07T13:45:55Z NONE

Actually It doesn't seem to be so simple, I will try to isolate the issue n my installation. Is there any way to disable dask explicitly so I can bypass this error?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Dask error when importing pip installed xarray. 1019478260
937771657 https://github.com/pydata/xarray/issues/5841#issuecomment-937771657 https://api.github.com/repos/pydata/xarray/issues/5841 IC_kwDOAMm_X8435UKJ twhughes 5669557 2021-10-07T13:03:40Z 2021-10-07T13:03:40Z NONE

Appreciate the help @keewis, I did some investigative work and it seems to work fine until I install PyYAML.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Dask error when importing pip installed xarray. 1019478260
937532627 https://github.com/pydata/xarray/issues/5841#issuecomment-937532627 https://api.github.com/repos/pydata/xarray/issues/5841 IC_kwDOAMm_X8434ZzT keewis 14808389 2021-10-07T07:35:22Z 2021-10-07T07:35:22Z MEMBER

that's strange, we even have a CI to make sure importing without having dask installed works. I also can't reproduce with bash mamba create -n test python=3.9.7 # new clean environment python -m pip install xarray python -c 'import xarray as xr' so maybe there's something wrong with your environment?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Dask error when importing pip installed xarray. 1019478260

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issue_comments] (
   [html_url] TEXT,
   [issue_url] TEXT,
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [created_at] TEXT,
   [updated_at] TEXT,
   [author_association] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
);
CREATE INDEX [idx_issue_comments_issue]
    ON [issue_comments] ([issue]);
CREATE INDEX [idx_issue_comments_user]
    ON [issue_comments] ([user]);
Powered by Datasette · Queries took 23.384ms · About: xarray-datasette
  • Sort ascending
  • Sort descending
  • Facet by this
  • Hide this column
  • Show all columns
  • Show not-blank rows