Dask client is not running on Colab. My code is:
from dask.distributed import Client, progress
client = Client()
client
and the error is:
/usr/local/lib/python3.6/dist-packages/distributed/bokeh/core.py:57: UserWarning:
Port 8787 is already in use.
Perhaps you already have a cluster running?
Hosting the diagnostics dashboard on a random port instead.
warnings.warn('\n' + msg)
tornado.application - ERROR - Multiple exceptions in yield list
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/tornado/gen.py", line 828, in callback
result_list.append(f.result())
File "/usr/local/lib/python3.6/dist-packages/tornado/concurrent.py", line 238, in result
raise_exc_info(self._exc_info)
File "<string>", line 4, in raise_exc_info
File "/usr/local/lib/python3.6/dist-packages/tornado/gen.py", line 1069, in run
yielded = self.gen.send(value)
File "/usr/local/lib/python3.6/dist-packages/distributed/deploy/local.py", line 229, in _start_worker
raise gen.TimeoutError("Worker failed to start")
tornado.gen.TimeoutError: Worker failed to start
---------------------------------------------------------------------------
TimeoutError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/tornado/gen.py in callback(f)
827 try:
--> 828 result_list.append(f.result())
829 except Exception as e:
33 frames
TimeoutError: Worker failed to start
During handling of the above exception, another exception occurred:
TimeoutError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/distributed/deploy/local.py in _start_worker(self, death_timeout, **kwargs)
227 if w.status == 'closed' and self.scheduler.status == 'running':
228 self.workers.remove(w)
--> 229 raise gen.TimeoutError("Worker failed to start")
230
231 raise gen.Return(w)
TimeoutError: Worker failed to start
To reproduce the error please see the following Colab gist:
The issue was also raised here https://github.com/dask/dask/issues/4843 with Dask
@cornhundred I was able to create a Dask LocalCluster in Colab this way:
from dask.distributed import Client, LocalCluster
cluster = LocalCluster(processes=False)
client = Client(cluster)
client
Just a note that the Dask dashboard does not work natively in Colab because websocket connections are not supported between the client and the kernel.
from dask.distributed import Client, progress
client = Client(processes=False)
client
Seems that it does not work anymore.
from dask.distributed import Client
client = Client(processes=False)
client
I have to modify with Client(processes=False, diagnostic_port=None)
It would be great to be able to access the diagnostic dashboard or to be able to see everything inside the notebook (with Progress).
Someone has a solution because everything runs well but with no supervision.
Most helpful comment
@cornhundred I was able to create a Dask LocalCluster in Colab this way: