Error importing distributed

For the following code:

import dask
import distributed

I get the error:
Traceback (most recent call last):
File “d:\temp\src\data_processing\temp.py”, line 2, in
import distributed
File “C:\Users\bhatn\temp\lib\site-packages\distributed_init_.py”, line 23, in
from distributed.actor import Actor, ActorFuture, BaseActorFuture
File “C:\Users\bhatn\temp\lib\site-packages\distributed\actor.py”, line 13, in
from distributed.client import Future
File “C:\Users\bhatn\temp\lib\site-packages\distributed\client.py”, line 115, in
from distributed.worker import get_client, get_worker, secede
File “C:\Users\bhatn\temp\lib\site-packages\distributed\worker.py”, line 117, in
from distributed.worker_memory import (
File “C:\Users\bhatn\temp\lib\site-packages\distributed\worker_memory.py”, line 55, in
WorkerDataParameter: TypeAlias = Union[
File “C:\Users\bhatn\AppData\Local\Programs\Python\Python39\lib\typing.py”, line 243, in inner
return func(*args, **kwds)
File “C:\Users\bhatn\AppData\Local\Programs\Python\Python39\lib\typing.py”, line 316, in getitem
return self._getitem(self, parameters)
File “C:\Users\bhatn\AppData\Local\Programs\Python\Python39\lib\typing.py”, line 421, in Union
parameters = _remove_dups_flatten(parameters)
File “C:\Users\bhatn\AppData\Local\Programs\Python\Python39\lib\typing.py”, line 215, in _remove_dups_flatten
all_params = set(params)
TypeError: unhashable type: ‘list’
Initially, I got the error trying to compute a dataframe. I did a fresh install of “dask[complete]” using PyPI on a new virtual environment. I am trying this on my local machine, and the environment has python 3.9. I have tried:

  1. Looking through and updating all dependencies, even optional ones;
  2. Installing only dask and distributed on a new virtual environment;
  3. Running the client on Google Colab, which seems to work until the point of starting the scheduler, but the localhost never responds, but that may be a separate issue;
  4. Looking through the FAQs, although I could not find anything

I am absolutely lost on what the source of this error might be, any help is appreciated!

Hi @alex, welcome to Dask community!

Well, this definitely look like some environment problem. I tried this on my Ubuntu laptop:

conda create -n daskpy39_test python=3.9
conda activate daskpy39_test
pip install dask[complete]
python
>>> import distributed
>>> import dask

Everything was fine for me. How was your Python 3.9 installed in the first place? Could you provide a complete reproducer?
Could you use only Conda to install everything from Python to Dask?