Repository: modin-project/modin

Issue:
Update Dask and Distributed minimum version to 2.12 for Python 3.8 compatibility
### System information
- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**: Win 10
- **Modin installed from (source or binary)**: pip
- **Modin version**: 0.6.3
- **Python version**: 3.8.0
- **Exact command to reproduce**: import modin.pandas as pd

### Describe the problem
Fresh install of modin, failure to import. Have tried pip --force-reinstall most dependencies.

### Source code / logs
```
UserWarning: The Dask Engine for Modin is experimental.
Traceback (most recent call last):
  File "C:\WERK\backtestStrat3\backtest.py", line 2, in <module>
    import modin.pandas as pd
  File "C:\Python\lib\site-packages\modin\pandas\__init__.py", line 226, in <module>
    client = Client()
  File "C:\Python\lib\site-packages\distributed\client.py", line 727, in __init__
    self.start(timeout=timeout)
  File "C:\Python\lib\site-packages\distributed\client.py", line 892, in start
    sync(self.loop, self._start, **kwargs)
  File "C:\Python\lib\site-packages\distributed\utils.py", line 334, in sync
    raise exc.with_traceback(tb)
  File "C:\Python\lib\site-packages\distributed\utils.py", line 318, in f
    result[0] = yield future
  File "C:\Python\lib\site-packages\tornado\gen.py", line 735, in run
    value = future.result()
  File "C:\Python\lib\site-packages\distributed\client.py", line 955, in _start
    self.cluster = await LocalCluster(
  File "C:\Python\lib\site-packages\distributed\deploy\spec.py", line 364, in _
    await self._start()
  File "C:\Python\lib\site-packages\distributed\deploy\spec.py", line 284, in _start
    self.scheduler = await self.scheduler
  File "C:\Python\lib\site-packages\distributed\scheduler.py", line 1219, in start
    await self.listen(addr, listen_args=self.listen_args)
  File "C:\Python\lib\site-packages\distributed\core.py", line 321, in listen
    await listener.start()
  File "C:\Python\lib\site-packages\distributed\comm\tcp.py", line 432, in start
    self.tcp_server.add_sockets(sockets)
  File "C:\Python\lib\site-packages\tornado\tcpserver.py", line 165, in add_sockets
    self._handlers[sock.fileno()] = add_accept_handler(
  File "C:\Python\lib\site-packages\tornado\netutil.py", line 279, in add_accept_handler
    io_loop.add_handler(sock, accept_handler, IOLoop.READ)
  File "C:\Python\lib\site-packages\tornado\platform\asyncio.py", line 99, in add_handler
    self.asyncio_loop.add_reader(fd, self._handle_events, fd, IOLoop.READ)
  File "C:\Python\lib\asyncio\events.py", line 501, in add_reader
    raise NotImplementedError
NotImplementedError
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "C:\Python\lib\contextlib.py", line 131, in __exit__
    self.gen.throw(type, value, traceback)
  File "C:\Python\lib\site-packages\distributed\utils.py", line 186, in ignoring
    yield
  File "C:\Python\lib\site-packages\distributed\deploy\spec.py", line 607, in close_clusters
    cluster.close(timeout=10)
  File "C:\Python\lib\site-packages\distributed\deploy\cluster.py", line 83, in close
    return self.sync(self._close, callback_timeout=timeout)
  File "C:\Python\lib\site-packages\distributed\deploy\cluster.py", line 162, in sync
    return sync(self.loop, func, *args, **kwargs)
  File "C:\Python\lib\site-packages\distributed\utils.py", line 334, in sync
    raise exc.with_traceback(tb)
  File "C:\Python\lib\site-packages\distributed\utils.py", line 318, in f
    result[0] = yield future
  File "C:\Python\lib\site-packages\tornado\gen.py", line 735, in run
    value = future.result()
  File "C:\Python\lib\site-packages\distributed\deploy\spec.py", line 380, in _close
    self.scale(0)
  File "C:\Python\lib\site-packages\distributed\deploy\spec.py", line 444, in scale
    v["name"] for v in self.scheduler_info["workers"].values()
KeyError: 'workers'
```





Discussion:
Hi @misantroop, thanks for posting!

This may be related to #905. Can you run the following and tell me what it prints:

```python
import dask
print(dask.__version__)
import distributed
print(distributed.__version__)
```

I wasn't able to reproduce the issue locally with the latest dask/distributed.
2.9.0 for both.
Thanks, can you tell me if the following code breaks for you?

```python
from distributed import Client
c = Client()
```
All versions at least until the last one of 1.x, all of 2.x and the latest commit fail. At least it's pinpointed to dask.
> ```
>   File "C:\Python\lib\site-packages\tornado\platform\asyncio.py", line 99, in add_handler
>     self.asyncio_loop.add_reader(fd, self._handle_events, fd, IOLoop.READ)
>   File "C:\Python\lib\asyncio\events.py", line 501, in add_reader
>     raise NotImplementedError
> ```

That's a Tornado + Python 3.8 issue on Windows. Python 3.8 changed some defaults. I posted a comment earlier today, Dask Distributed probably needs a small patch: https://github.com/dask/distributed/pull/3249#issuecomment-569539093
The PR linked above has been merged, and it's fixed in Distributed 2.11 or maybe 2.12 and later, so this can probably be closed.
@itamarst It is probably worth updating our minimum Dask and Distributed versions to ensure compatibility with Python 3.8.

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -37,7 +37,7 @@ def is_pure(self):
         return False
 
 
-dask_deps = ["dask>=2.1.0", "distributed>=2.3.2"]
+dask_deps = ["dask>=2.12.0", "distributed>=2.12.0"]
 ray_deps = ["ray==0.8.6", "pyarrow<0.17"]
 
 all_deps = dask_deps + ray_deps


Test patch: