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

Dask not properly supported when creating binaries with PyInstaller #9487

Closed
3 of 5 tasks
uriii3 opened this issue Sep 12, 2024 · 4 comments
Closed
3 of 5 tasks

Dask not properly supported when creating binaries with PyInstaller #9487

uriii3 opened this issue Sep 12, 2024 · 4 comments
Labels
bug topic-chunked-arrays Managing different chunked backends, e.g. dask

Comments

@uriii3
Copy link

uriii3 commented Sep 12, 2024

What happened?

I was trying to do a binary from a library but an error throws, once the executable file is already created:
ValueError: unrecognized chunk manager dask - must be one of: []
There is an issue already created Issue 7856 but is marked as closed. There, they talk about the implementation between array and dask, which seems to be the problem. Anyway, I can run the minimal complete example (and the library too) perfectly in my computer but then, once the library is created is seems to not be correctly handled.

What did you expect to happen?

That after creating the binary the executable file works like in the computer when I run it.

In the minimal example, I've used the code from the original bug. The only thing, though, is that afterwards I create a binary with it: >python -m PyInstaller my_file.py (and follow the instructions for the my_file.spec).

After creating the binary, the executable file doesn't work anymore.

Minimal Complete Verifiable Example

import numpy as np
import pandas as pd
import xarray as xr


t_size = 800
t = np.arange(t_size)
var = xr.Variable(dims=("T",), data=np.random.randn(t_size)).chunk()

MVCE confirmation

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

Relevant log output

Traceback (most recent call last):
  File "my_file.py", line 8, in <module>
  File "xarray\core\variable.py", line 1250, in chunk
  File "xarray\core\parallelcompat.py", line 93, in guess_chunkmanager
ValueError: unrecognized chunk manager dask - must be one of: []
[PYI-5828:ERROR] Failed to execute script 'my_file' due to unhandled exception!

Anything else we need to know?

I'm not sure if the bug is on your side or the handling of the dependencies on the PyInstaller side, I'm sorry if it s not relevant for you (but the previous bug seems to make it a little similar to it).

Environment

INSTALLED VERSIONS

commit: None
python: 3.12.6 (tags/v3.12.6:a4a2d2b, Sep 6 2024, 20:11:23) [MSC v.1940 64 bit (AMD64)]
python-bits: 64
OS: Windows
OS-release: 11
machine: AMD64
processor: Intel64 Family 6 Model 85 Stepping 7, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
LOCALE: ('English_United Kingdom', '1252')
libhdf5: 1.14.3
libnetcdf: 4.9.2

xarray: 2023.7.0
pandas: 2.2.2
numpy: 1.26.4
scipy: 1.14.1
netCDF4: 1.7.1.post2
pydap: None
h5netcdf: 1.3.0
h5py: 3.11.0
Nio: None
zarr: 2.18.2
cftime: 1.6.4
nc_time_axis: 1.4.1
PseudoNetCDF: None
iris: None
bottleneck: 1.4.0
dask: 2024.8.1
distributed: 2024.8.1
matplotlib: 3.9.2
cartopy: None
seaborn: 0.13.2
numbagg: 0.8.1
fsspec: 2024.6.1
cupy: None
pint: None
sparse: None
flox: 0.9.10
numpy_groupies: 0.11.2
setuptools: 73.0.1
pip: 24.2
conda: None
pytest: 8.3.3
mypy: 1.11.2
IPython: None
sphinx: None

@uriii3 uriii3 added bug needs triage Issue that has not been reviewed by xarray team member labels Sep 12, 2024
Copy link

welcome bot commented Sep 12, 2024

Thanks for opening your first issue here at xarray! Be sure to follow the issue template!
If you have an idea for a solution, we would really welcome a Pull Request with proposed changes.
See the Contributing Guide for more.
It may take us a while to respond here, but we really value your contribution. Contributors like you help make xarray better.
Thank you!

@TomNicholas
Copy link
Member

Hi @uriii3 - I'm not sure exactly what is going on here, but are you completely sure that PyInstaller is installing dask and everything it needs? Normally this error basically just means that dask is not installed.

@TomNicholas TomNicholas added topic-chunked-arrays Managing different chunked backends, e.g. dask and removed needs triage Issue that has not been reviewed by xarray team member labels Sep 12, 2024
@uriii3
Copy link
Author

uriii3 commented Sep 12, 2024

Hello, thanks a lot for the quick response. I'm not that sure, I also created an issue in their repo (here). Definitely looks like a problem on the libraries, although because of this issue I thought that it might still have something to do with your library or that you could maybe point me in a closer direction to the solution.
If it is something about the libraries I'll keep fighting with them, no worries and thank you very much.

@uriii3
Copy link
Author

uriii3 commented Sep 12, 2024

Hello again, it was indeed something about the libraries.

From what I understood in here, one of the issues seems to be how in xarray the 'chunk.managers' is imported. But it looks like it has been solved on their side!

Thanks a lot for the quick response!

@uriii3 uriii3 closed this as completed Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug topic-chunked-arrays Managing different chunked backends, e.g. dask
Projects
None yet
Development

No branches or pull requests

2 participants