From dask.distributed import Client doesn't work


#1

Hello,
I installed dask via pip in my notebook, but dask.distributed won’t work. Any ideas what that might be?

from dask.distributed import Client
client = Client()

ImportError                               Traceback (most recent call last)
<ipython-input-3-9401240f7f98> in <module>()
----> 1 from dask.distributed import Client
      2 client = Client()

ImportError: No module named 'dask'

!pip install "dask[complete]"

from dask.distributed import Client
client = Client()

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
/usr/local/lib/python3.5/dist-packages/dask/distributed.py in <module>()
      4 try:
----> 5     from distributed import *
      6 except ImportError:

/usr/local/lib/python3.5/dist-packages/distributed/__init__.py in <module>()
      4 from dask.config import config
----> 5 from .actor import Actor, ActorFuture
      6 from .core import connect, rpc

/usr/local/lib/python3.5/dist-packages/distributed/actor.py in <module>()
----> 1 from tornado import gen
      2 import functools
      3 

/usr/local/lib/python3.5/dist-packages/tornado/gen.py in <module>()
    100 
--> 101 from tornado.concurrent import (Future, is_future, chain_future, future_set_exc_info,
    102                                 future_add_done_callback, future_set_result_unless_cancelled)

ImportError: cannot import name 'future_set_exc_info'

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
<ipython-input-5-9401240f7f98> in <module>()
----> 1 from dask.distributed import Client
      2 client = Client()

/usr/local/lib/python3.5/dist-packages/dask/distributed.py in <module>()
      9            "  conda install dask distributed          # either conda install\n"
     10            "  pip install dask distributed --upgrade  # or pip install")
---> 11     raise ImportError(msg)

ImportError: Dask's distributed scheduler is not installed.

Please either conda or pip install dask distributed:

  conda install dask distributed          # either conda install
  pip install dask distributed --upgrade  # or pip install

#2

Here is the out from the dask installation:

Collecting dask[complete] Downloading https://files.pythonhosted.org/packages/06/d9/335788a25a72d4d4edbb01d6df3ca9dfc372737e1145cf73cda3a7d5e7de/dask-1.1.2-py2.py3-none-any.whl (704kB) 100% |################################| 706kB 2.4MB/s eta 0:00:01 Collecting distributed&gt;=1.22; extra == "complete" (from dask[complete]) Downloading https://files.pythonhosted.org/packages/e7/52/08ead8f0968d42510630f307100307b481298696cb7de81d58f0cdf7f320/distributed-1.26.0-py2.py3-none-any.whl (506kB) 100% |################################| 512kB 3.3MB/s eta 0:00:01 Collecting toolz&gt;=0.7.3; extra == "complete" (from dask[complete]) Downloading https://files.pythonhosted.org/packages/14/d0/a73c15bbeda3d2e7b381a36afb0d9cd770a9f4adc5d1532691013ba881db/toolz-0.9.0.tar.gz (45kB) 100% |################################| 51kB 9.6MB/s eta 0:00:01 Collecting partd&gt;=0.3.8; extra == "complete" (from dask[complete]) Downloading https://files.pythonhosted.org/packages/e2/bc/4dfd1e62e04a26d7ee56ade63af15e3249aeb3ed05d70ac590da2ca7c44d/partd-0.3.9-py2.py3-none-any.whl Collecting cloudpickle&gt;=0.2.1; extra == "complete" (from dask[complete]) Downloading https://files.pythonhosted.org/packages/47/d5/efa7cacef5d3bdcd71d7053a698fb9b64a20fff5cb3c592efefa53ea5578/cloudpickle-0.8.0-py2.py3-none-any.whl Requirement already satisfied: pandas&gt;=0.19.0; extra == "complete" in /usr/local/lib/python3.5/dist-packages (from dask[complete]) Requirement already satisfied: numpy&gt;=1.11.0; extra == "complete" in /usr/local/lib/python3.5/dist-packages (from dask[complete]) Collecting pyyaml (from distributed&gt;=1.22; extra == "complete"-&gt;dask[complete]) Downloading https://files.pythonhosted.org/packages/9e/a3/1d13970c3f36777c583f136c136f804d70f500168edc1edea6daa7200769/PyYAML-3.13.tar.gz (270kB) 100% |################################| 276kB 5.4MB/s eta 0:00:01 Collecting click&gt;=6.6 (from distributed&gt;=1.22; extra == "complete"-&gt;dask[complete]) Downloading https://files.pythonhosted.org/packages/fa/37/45185cb5abbc30d7257104c434fe0b07e5a195a6847506c074527aa599ec/Click-7.0-py2.py3-none-any.whl (81kB) 100% |################################| 81kB 12.4MB/s ta 0:00:01 Collecting psutil&gt;=5.0 (from distributed&gt;=1.22; extra == "complete"-&gt;dask[complete]) Downloading https://files.pythonhosted.org/packages/c7/01/7c30b247cdc5ba29623faa5c8cf1f1bbf7e041783c340414b0ed7e067c64/psutil-5.5.1.tar.gz (426kB) 100% |################################| 430kB 3.8MB/s eta 0:00:01 Requirement already satisfied: six in /usr/local/lib/python3.5/dist-packages (from distributed&gt;=1.22; extra == "complete"-&gt;dask[complete]) Collecting msgpack (from distributed&gt;=1.22; extra == "complete"-&gt;dask[complete]) Downloading https://files.pythonhosted.org/packages/3d/44/4a8be4f56ab3c8fc58800c06b2d681d5622704746d094411f00e25300072/msgpack-0.6.1-cp35-cp35m-manylinux1_x86_64.whl (243kB) 100% |################################| 245kB 6.1MB/s eta 0:00:01 Collecting sortedcontainers!=2.0.0,!=2.0.1 (from distributed&gt;=1.22; extra == "complete"-&gt;dask[complete]) Downloading https://files.pythonhosted.org/packages/13/f3/cf85f7c3a2dbd1a515d51e1f1676d971abe41bba6f4ab5443240d9a78e5b/sortedcontainers-2.1.0-py2.py3-none-any.whl Collecting tornado&gt;=5 (from distributed&gt;=1.22; extra == "complete"-&gt;dask[complete]) Downloading https://files.pythonhosted.org/packages/e6/78/6e7b5af12c12bdf38ca9bfe863fcaf53dc10430a312d0324e76c1e5ca426/tornado-5.1.1.tar.gz (516kB) 100% |################################| 522kB 3.1MB/s eta 0:00:01 Collecting tblib (from distributed&gt;=1.22; extra == "complete"-&gt;dask[complete]) Downloading https://files.pythonhosted.org/packages/4a/82/1b9fba6e93629a8557f9784cd8f1ae063c8762c26446367a6764edd328ce/tblib-1.3.2-py2.py3-none-any.whl Collecting zict&gt;=0.1.3 (from distributed&gt;=1.22; extra == "complete"-&gt;dask[complete]) Downloading https://files.pythonhosted.org/packages/5d/c9/eddd6c9a7ebd65fc799f9b87e56b45599a4e35d66e3da2722d7fc2a89f1f/zict-0.1.3-py2.py3-none-any.whl Collecting locket (from partd&gt;=0.3.8; extra == "complete"-&gt;dask[complete]) Downloading https://files.pythonhosted.org/packages/d0/22/3c0f97614e0be8386542facb3a7dcfc2584f7b83608c02333bced641281c/locket-0.2.0.tar.gz Requirement already satisfied: pytz&gt;=2011k in /usr/local/lib/python3.5/dist-packages (from pandas&gt;=0.19.0; extra == "complete"-&gt;dask[complete]) Requirement already satisfied: python-dateutil&gt;=2 in /usr/local/lib/python3.5/dist-packages (from pandas&gt;=0.19.0; extra == "complete"-&gt;dask[complete]) Collecting heapdict (from zict&gt;=0.1.3-&gt;distributed&gt;=1.22; extra == "complete"-&gt;dask[complete]) Downloading https://files.pythonhosted.org/packages/e2/ca/f5feba2f939c97629dbce52a17acc95a0d10256ef620334795379dda8ce6/HeapDict-1.0.0.tar.gz Building wheels for collected packages: toolz, pyyaml, psutil, tornado, locket, heapdict Running setup.py bdist_wheel for toolz ... done Stored in directory: /root/.cache/pip/wheels/f4/0c/f6/ce6b2d1aa459ee97cc3c0f82236302bd62d89c86c700219463 Running setup.py bdist_wheel for pyyaml ... done Stored in directory: /root/.cache/pip/wheels/ad/da/0c/74eb680767247273e2cf2723482cb9c924fe70af57c334513f Running setup.py bdist_wheel for psutil ... done Stored in directory: /root/.cache/pip/wheels/b4/9c/85/b73f594568ccc19c310ec6c61564346dd16c96aa2c35c5849a Running setup.py bdist_wheel for tornado ... done Stored in directory: /root/.cache/pip/wheels/6d/e1/ce/f4ee2fa420cc6b940123c64992b81047816d0a9fad6b879325 Running setup.py bdist_wheel for locket ... done Stored in directory: /root/.cache/pip/wheels/26/1e/e8/4fa236ec931b1a0cdd61578e20d4934d7bf188858723b84698 Running setup.py bdist_wheel for heapdict ... done Stored in directory: /root/.cache/pip/wheels/40/b9/42/344857b482c954f48bcff6db72d388e30bf2bee4ed14706faa Successfully built toolz pyyaml psutil tornado locket heapdict Installing collected packages: pyyaml, click, psutil, msgpack, sortedcontainers, toolz, tornado, tblib, cloudpickle, heapdict, zict, distributed, locket, partd, dask Found existing installation: tornado 4.5.3 Uninstalling tornado-4.5.3: Successfully uninstalled tornado-4.5.3 Successfully installed click-7.0 cloudpickle-0.8.0 dask-1.1.2 distributed-1.26.0 heapdict-1.0.0 locket-0.2.0 msgpack-0.6.1 partd-0.3.9 psutil-5.5.1 pyyaml-3.13 sortedcontainers-2.1.0 tblib-1.3.2 toolz-0.9.0 tornado-5.1.1 zict-0.1.3 You are using pip version 9.0.1, however version 19.0.3 is available. You should consider upgrading via the 'pip install --upgrade pip' command.