scenicplus icon indicating copy to clipboard operation
scenicplus copied to clipboard

The version of dask may need to be updated to be compatible with python 3.11.9.

Open WhenMelancholy opened this issue 1 year ago • 3 comments

Describe the bug While using the snakemake pipeline to process the example data, I encountered the following error ( I only took the the last section since the call stack is very deep)

    from dask.dataframe import methods                                                                                                                                       [90/1631]
  File "/home/aiscuser/miniforge3/envs/scenic/lib/python3.11/site-packages/dask/dataframe/methods.py", line 34, in <module>                                                           
    from dask.dataframe.utils import is_dataframe_like, is_index_like, is_series_like                                                                                                 
  File "/home/aiscuser/miniforge3/envs/scenic/lib/python3.11/site-packages/dask/dataframe/utils.py", line 20, in <module>                                                             
    from dask.dataframe import (  # noqa: F401 register pandas extension types                                                                                                        
  File "/home/aiscuser/miniforge3/envs/scenic/lib/python3.11/site-packages/dask/dataframe/_dtypes.py", line 9, in <module>                                                            
    from dask.dataframe.extensions import make_array_nonempty, make_scalar                                                                                                            
  File "/home/aiscuser/miniforge3/envs/scenic/lib/python3.11/site-packages/dask/dataframe/extensions.py", line 8, in <module>
    from dask.dataframe.accessor import (
  File "/home/aiscuser/miniforge3/envs/scenic/lib/python3.11/site-packages/dask/dataframe/accessor.py", line 126, in <module>
    class DatetimeAccessor(Accessor):
  File "/home/aiscuser/miniforge3/envs/scenic/lib/python3.11/site-packages/dask/dataframe/accessor.py", line 81, in __init_subclass__
    _bind_property(cls, pd_cls, attr, min_version)
  File "/home/aiscuser/miniforge3/envs/scenic/lib/python3.11/site-packages/dask/dataframe/accessor.py", line 35, in _bind_property
    setattr(cls, attr, property(derived_from(pd_cls, version=min_version)(func)))
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aiscuser/miniforge3/envs/scenic/lib/python3.11/site-packages/dask/utils.py", line 987, in wrapper
    method.__doc__ = _derived_from(
                     ^^^^^^^^^^^^^^
  File "/home/aiscuser/miniforge3/envs/scenic/lib/python3.11/site-packages/dask/utils.py", line 940, in _derived_from
    method_args = get_named_args(method)
                  ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aiscuser/miniforge3/envs/scenic/lib/python3.11/site-packages/dask/utils.py", line 701, in get_named_args
    s = inspect.signature(func)
        ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aiscuser/miniforge3/envs/scenic/lib/python3.11/inspect.py", line 3263, in signature
    return Signature.from_callable(obj, follow_wrapped=follow_wrapped,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aiscuser/miniforge3/envs/scenic/lib/python3.11/inspect.py", line 3011, in from_callable
    return _signature_from_callable(obj, sigcls=cls,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aiscuser/miniforge3/envs/scenic/lib/python3.11/inspect.py", line 2599, in _signature_from_callable
    call = _descriptor_get(call, obj)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aiscuser/miniforge3/envs/scenic/lib/python3.11/inspect.py", line 2432, in _descriptor_get
    return get(descriptor, obj, type(obj))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: descriptor '__call__' for 'type' objects doesn't apply to a 'property' object
"""

To Reproduce Processing sample data using the snakemake pipeline.

Error output See the Describe the bug section.

Expected behavior No ValueError should be throwed.

Screenshots N/A

Version (please complete the following information):

  • Python: Python 3.11
  • SCENIC+: commit 3f0e372
  • If a bug is related to another module: related to snakemake pipeline

Additional context According to my investigation, this is due to an incompatibility between the dask and python versions. the version of dask used by scenicplus is incompatible with python 3.11.9 (issue here), but 3.11.9 is the latest python 3.11 release, which is used when creating conda environments as described in the README. So the dask version may need to be updated?

After updating the version of dask to 2024.05, this problem got solved.

WhenMelancholy avatar May 04 '24 19:05 WhenMelancholy

Thanks a lot! Solved my issue. Note that if using mamba or conda to update dask, I think it will automatically update pandas version. While scenicplus requires pandas=1.5.0, better use pip install dask[array,complete,dataframe,diagnostics,distributed]==2024.5.0 to avoid other conflicts. Ignore the pip install error, the scenicplus could run properly.

Richardosgrapevine avatar May 11 '24 07:05 Richardosgrapevine

Hi. In my case, got the same error and I tried the pip install inside a conda environment as suggested by @Richardosgrapevine , but it did proceed to update pandas to 2.2.2, which then created error in the scenicplus pipeline of course. I haven't figured out how to reverse it or make everything correct (due to pin-1 requiring python 3.11.* while pandas 1.5.0, doesn't).

Edit: got it to work using the following install if that can help someone, including java for mallet and jupyterlab, with dask version 2024.4.1: ` conda activate scenicplus

pip install .

conda install jupyter jupyterlab

conda install conda-forge::openjdk

pip install dask==2024.4.1 `

JABioinf avatar Jul 31 '24 18:07 JABioinf

Hi. In my case, got the same error and I tried the pip install inside a conda environment as suggested by @Richardosgrapevine , but it did proceed to update pandas to 2.2.2, which then created error in the scenicplus pipeline of course. I haven't figured out how to reverse it or make everything correct (due to pin-1 requiring python 3.11.* while pandas 1.5.0, doesn't).

Edit: got it to work using the following install if that can help someone, including java for mallet and jupyterlab, with dask version 2024.4.1: ` conda activate scenicplus

pip install .

conda install jupyter jupyterlab

conda install conda-forge::openjdk

pip install dask==2024.4.1 `

I just downgraded the pandas==1.5.0 (as that is what is required by scenicplus) and it worked.

yojetsharma avatar Oct 17 '24 15:10 yojetsharma