dask / dask-jobqueue

Deploy Dask on job schedulers like PBS, SLURM, and SGE
https://jobqueue.dask.org
BSD 3-Clause "New" or "Revised" License
235 stars 142 forks source link

TypeError: unhashable type: 'list' when importing dask-jobqueue #624

Closed josepalos closed 7 months ago

josepalos commented 9 months ago

Describe the issue: I have access to a computation cluster in my university. I wanted to try SGECluster, so I installed in a fresh virtual environment "dask-jobqueue". When I try to import it, it raises a TypeError.

Minimal Complete Verifiable Example:

$ python3 -m venv venv
$ source venv/bin/activate
(venv) $python3 -m pip install -U pip
(venv) $ python3 -m pip install dask-jobqueue
(venv) $ python3
Python 3.9.1 (default, Aug  3 2021, 10:37:51)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import dask_jobqueue
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/saas/venv/lib/python3.9/site-packages/dask_jobqueue/__init__.py", line 3, in <module>
    from .core import JobQueueCluster
  File "/home/saas/venv/lib/python3.9/site-packages/dask_jobqueue/core.py", line 19, in <module>
    from distributed.core import Status
  File "/home/saas/venv/lib/python3.9/site-packages/distributed/__init__.py", line 23, in <module>
    from distributed.actor import Actor, ActorFuture, BaseActorFuture
  File "/home/saas/venv/lib/python3.9/site-packages/distributed/actor.py", line 13, in <module>
    from distributed.client import Future
  File "/home/saas/venv/lib/python3.9/site-packages/distributed/client.py", line 117, in <module>
    from distributed.worker import get_client, get_worker, secede
  File "/home/saas/venv/lib/python3.9/site-packages/distributed/worker.py", line 120, in <module>
    from distributed.worker_memory import (
  File "/home/saas/venv/lib/python3.9/site-packages/distributed/worker_memory.py", line 56, in <module>
    WorkerDataParameter: TypeAlias = Union[
  File "/state/partition1/opt/python/3.9.1/lib/python3.9/typing.py", line 262, in inner
    return func(*args, **kwds)
  File "/state/partition1/opt/python/3.9.1/lib/python3.9/typing.py", line 339, in __getitem__
    return self._getitem(self, parameters)
  File "/state/partition1/opt/python/3.9.1/lib/python3.9/typing.py", line 451, in Union
    parameters = _remove_dups_flatten(parameters)
  File "/state/partition1/opt/python/3.9.1/lib/python3.9/typing.py", line 231, in _remove_dups_flatten
    return tuple(_deduplicate(params))
  File "/state/partition1/opt/python/3.9.1/lib/python3.9/typing.py", line 205, in _deduplicate
    all_params = set(params)
TypeError: unhashable type: 'list'

Anything else we need to know?:

Environment:

leffetripel commented 8 months ago

Had this issue with my virtual environment, problem solved after updating environment to python=3.10

guillaumeeb commented 7 months ago

Hi, as reported in distributed: https://github.com/dask/distributed/issues/7956, this is a Python 3.9.1 bug. So you'll need to update Python in order to fix it.

josepalos commented 7 months ago

Oh, okay. Sorry, didn't see it was from python. Thanks for the heads up