home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 1900706633

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
1900706633 I_kwDOAMm_X85xSntJ 8200 Wrong fallback version number when using PyInstaller 31126826 closed 0     3 2023-09-18T11:13:53Z 2023-09-18T12:14:10Z 2023-09-18T12:08:04Z CONTRIBUTOR      

What is your issue?

I'm trying to bundle some code using Xarray with PyInstaller.

As a MRE, consider the following file:

```python

test.py

import pandas as pd import xarray as xr print(xr.version) pd.DataFrame({'a': range(10)}).to_xarray() and the following command-line to build and run the Pyinstaller executable:shell pyinstaller test.py && dist/test/test ```


Ideally, I would have expected the printed version to be 2023.8.0 (as when running the script without Pyinstaller). The fallback 9999 from https://github.com/pydata/xarray/blob/b08a9d868febc0c6aa0944d654ec92d833a70c37/xarray/init.py#L55 would also have done the job.

Unfortunately, the actual version number is '999' which make the following pandas code to fail with: Traceback (most recent call last): File "test.py", line 4, in <module> pd.DataFrame({'a': range(10)}).to_xarray() File "pandas/core/generic.py", line 3243, in to_xarray File "pandas/compat/_optional.py", line 161, in import_optional_dependency ImportError: Pandas requires version '2022.03.0' or newer of 'xarray' (version '999' currently installed).


As a workaround, I added the line python xr.__version__ = "9999" in my test.py file...

Versions ``` INSTALLED VERSIONS ------------------ commit: None python: 3.9.17 (main, Jul 5 2023, 20:41:20) [GCC 11.2.0] python-bits: 64 OS: Linux OS-release: 6.2.0-32-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: fr_FR.UTF-8 LOCALE: ('fr_FR', 'UTF-8') libhdf5: None libnetcdf: None xarray: 2023.8.0 pandas: 2.1.0 numpy: 1.26.0 scipy: None netCDF4: None pydap: None h5netcdf: None h5py: None Nio: None zarr: None cftime: None nc_time_axis: None PseudoNetCDF: None iris: None bottleneck: None dask: None distributed: None matplotlib: None cartopy: None seaborn: None numbagg: None fsspec: None cupy: None pint: None sparse: None flox: None numpy_groupies: None setuptools: 58.1.0 pip: 23.0.1 conda: None pytest: None mypy: None IPython: None sphinx: None ```
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8200/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

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