Debian Codegraph @

docs/source/install.rst

raw
1 Dask Installation
2 =================
3
4 .. meta::
5 :description: Dask Installation | You can easily install Dask with conda or pip
6
7 .. _Anaconda distribution: https://www.anaconda.com/download/
8
9 How to Install Dask
10 -------------------
11
12 You can install Dask with ``conda``, with ``pip``, or install from source.
13
14 .. tab-set::
15
16 .. tab-item:: Conda
17
18 If you use the `Anaconda distribution`_, Dask will be installed by default.
19
20 You can also install or upgrade Dask using the
21 `conda install <https://docs.conda.io/projects/conda/en/latest/commands/install.html>`_ command::
22
23 conda install dask
24
25 This installs Dask and **all** common dependencies, including pandas and NumPy.
26 Dask packages are maintained both on the defaults channel and on
27 `conda-forge <https://conda-forge.github.io/>`_.
28 You can select the channel with the ``-c`` flag::
29
30 conda install dask -c conda-forge
31
32 Optionally, you can obtain a minimal Dask installation using the following command::
33
34 conda install dask-core
35
36 This will install a minimal set of dependencies required to run Dask similar to (but not exactly the same as) ``python -m pip install dask``.
37
38 .. tab-item:: Pip
39
40 To install Dask with ``pip`` run the following::
41
42 python -m pip install "dask[complete]" # Install everything
43
44 This installs Dask, the distributed scheduler, and common dependencies
45 like pandas, Numpy, and others.
46
47 You can also install only the Dask library and no optional dependencies::
48
49 python -m pip install dask # Install only core parts of dask
50
51 Dask modules like ``dask.array``, ``dask.dataframe``, or
52 ``dask.distributed`` won't work until you also install NumPy, pandas, or
53 Tornado, respectively. This is uncommon for users but more common for
54 downstream library maintainers.
55
56 We also maintain other dependency sets for different subsets of functionality::
57
58 python -m pip install "dask[array]" # Install requirements for dask array
59 python -m pip install "dask[dataframe]" # Install requirements for dask dataframe
60 python -m pip install "dask[diagnostics]" # Install requirements for dask diagnostics
61 python -m pip install "dask[distributed]" # Install requirements for distributed dask
62
63 We have these options so that users of the lightweight core Dask scheduler
64 aren't required to download the more exotic dependencies of the collections
65 (Numpy, pandas, Tornado, etc.).
66
67 .. tab-item:: Source
68
69 To install Dask from source, clone the repository from `GitHub
70 <https://github.com/dask/dask>`_::
71
72 git clone https://github.com/dask/dask.git
73 cd dask
74 python -m pip install .
75
76 You can also install all dependencies as well::
77
78 python -m pip install ".[complete]"
79
80 You can view the list of all dependencies within the ``project.optional-dependencies`` field
81 of ``pyproject.toml``.
82
83 Or do a developer install by using the ``-e`` flag
84 (see the :ref:`Install section <develop-install>` in the Development Guidelines)::
85
86 python -m pip install -e .
87
88 Distributed Deployment
89 ----------------------
90
91 To run Dask on a distributed cluster you will want to also install the Dask
92 cluster manager that matches your resource manager, like Kubernetes, SLURM, PBS,
93 LSF, AWS, GCP, Azure, or similar technology.
94
95 Read more on this topic at :bdg-link-primary:`Deploy Documentation <deploying.html>`
96
97 Optional dependencies
98 ---------------------
99
100 Specific functionality in Dask may require additional optional dependencies.
101 For example, reading from Amazon S3 requires `s3fs`_.
102 These optional dependencies and their minimum supported versions are listed below.
103
104 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
105 | Dependency | Version | Description |
106 +==================+=================+=========================================================================================================+
107 | `bokeh`_ | ``>=3.1.0`` | Generate profiles of Dask execution (required for ``dask.diagnostics``) |
108 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
109 | `bottleneck`_ | ``>=1.3.7`` | Used for dask arrays ``push`` implementation |
110 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
111 | `cachey`_ | ``>=0.1.1`` | Use caching for computation |
112 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
113 | `cityhash`_ | ``>=0.2.4`` | Use CityHash and FarmHash hash functions for array hashing (~2x faster than MurmurHash) |
114 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
115 | `crick`_ | ``>=0.0.5`` | Use ``tdigest`` internal method for dataframe statistics computation |
116 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
117 | `cytoolz`_ | ``>=0.11.2`` | Faster cythonized implementation of internal iterators, functions, and dictionaries |
118 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
119 | `dask-expr`_ | | Required for ``dask.dataframe``; Pins to a specific Dask version |
120 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
121 | `dask-ml`_ | ``>=1.4.0`` | Common machine learning functions scaled with Dask |
122 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
123 | `fastavro`_ | ``>=1.1.0`` | Storing and reading data from Apache Avro files |
124 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
125 | `gcsfs`_ | ``>=2021.9.0`` | Storing and reading data located in Google Cloud Storage |
126 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
127 | `graphviz`_ | ``>=0.8.4`` | Graph visualization using the graphviz engine |
128 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
129 | `h5py`_ | ``>=3.4.0`` | Storing array data in hdf5 files |
130 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
131 | `ipycytoscape`_ | ``>=1.0.1`` | Graph visualization using the cytoscape engine |
132 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
133 | `IPython`_ | ``>=7.30.1`` | Write graph visualizations made with graphviz engine to file |
134 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
135 | `jinja2`_ | ``>=2.10.3`` | HTML representations of Dask objects in Jupyter notebooks (required for ``dask.diagnostics``) |
136 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
137 | `lz4`_ | ``>=4.3.2`` | Transparent use of lz4 compression algorithm |
138 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
139 | `matplotlib`_ | ``>=3.5.0`` | Color map support for graph visualization |
140 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
141 | `mimesis`_ | ``>=5.3.0`` | Random bag data generation with :func:`dask.datasets.make_people` |
142 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
143 | `mmh3`_ | ``>=3.0.0`` | Use MurmurHash hash functions for array hashing (~8x faster than SHA1) |
144 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
145 | `numpy`_ | ``>=1.24`` | Required for ``dask.array`` |
146 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
147 | `pandas`_ | ``>=2.0`` | Required for ``dask.dataframe`` |
148 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
149 | `psutil`_ | ``>=5.8.0`` | Factor CPU affinity into CPU count, intelligently infer blocksize when reading CSV files |
150 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
151 | `pyarrow`_ | ``>=14.0.1`` | Support for Apache Arrow datatypes & engine when storing/reading Apache ORC or Parquet files |
152 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
153 | `python-snappy`_ | ``>=0.6.0`` | Snappy compression to bs used when storing/reading Avro or Parquet files |
154 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
155 | `s3fs`_ | ``>=2021.9.0`` | Storing and reading data located in Amazon S3 |
156 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
157 | `scipy`_ | ``>=1.7.2`` | Required for ``dask.array.stats``, ``dask.array.fft``, and :func:`dask.array.linalg.lu` |
158 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
159 | `sparse`_ | ``>=0.13.0`` | Use sparse arrays as backend for dask arrays |
160 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
161 | `sqlalchemy`_ | ``>=1.4.26`` | Writing and reading from SQL databases |
162 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
163 | `tblib`_ | ``>=1.6.0`` | Serialization of worker traceback objects |
164 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
165 | `tiledb`_ | ``>=0.12.0`` | Storing and reading data from TileDB files |
166 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
167 | `xxhash`_ | ``>=2.0.0`` | Use xxHash hash functions for array hashing (~2x faster than MurmurHash, slightly slower than CityHash) |
168 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
169 | `zarr`_ | ``>=2.12.0`` | Storing and reading data from Zarr files |
170 +------------------+-----------------+---------------------------------------------------------------------------------------------------------+
171
172 Test
173 ----
174
175 Test Dask with ``py.test``::
176
177 cd dask
178 py.test dask
179
180 Installing Dask naively may not install all requirements by default (see the ``pip`` section above).
181 You may choose to install the ``dask[complete]`` version which includes
182 all dependencies for all collections::
183
184 pip install "dask[complete]"
185
186 Alternatively, you may choose to test
187 only certain submodules depending on the libraries within your environment.
188 For example, to test only Dask core and Dask array we would run tests as
189 follows::
190
191 py.test dask/tests dask/array/tests
192
193 See the :ref:`section on testing <develop-test>` in the Development Guidelines for more details.
194
195 .. _Anaconda distribution: https://www.anaconda.com/download/
196 .. _s3fs: https://s3fs.readthedocs.io/en/latest/
197 .. _bokeh: https://bokeh.org/
198 .. _bottleneck: https://bottleneck.readthedocs.io/en/latest/index.html
199 .. _cachey: https://github.com/dask/cachey
200 .. _cityhash: https://github.com/escherba/python-cityhash
201 .. _crick: https://github.com/dask/crick
202 .. _cytoolz: https://github.com/pytoolz/cytoolz
203 .. _dask-expr: https://github.com/dask-contrib/dask-expr
204 .. _dask-ml: https://ml.dask.org/
205 .. _fastavro: https://fastavro.readthedocs.io/en/latest/
206 .. _graphviz: https://graphviz.readthedocs.io/en/stable/
207 .. _gcsfs: https://gcsfs.readthedocs.io/en/latest/
208 .. _h5py: https://www.h5py.org/
209 .. _ipycytoscape: https://ipycytoscape.readthedocs.io/en/master/index.html
210 .. _IPython: https://ipython.org/
211 .. _jinja2: https://jinja.palletsprojects.com/
212 .. _lz4: https://python-lz4.readthedocs.io/en/stable/index.html
213 .. _matplotlib: https://matplotlib.org/
214 .. _mimesis: https://mimesis.name/en/master/
215 .. _mmh3: https://github.com/hajimes/mmh3
216 .. _numpy: https://numpy.org/
217 .. _pandas: https://pandas.pydata.org/
218 .. _psutil: https://psutil.readthedocs.io/en/latest/
219 .. _pyarrow: https://arrow.apache.org/docs/python/index.html
220 .. _python-snappy: https://github.com/andrix/python-snappy
221 .. _scikit-image: https://scikit-image.org/
222 .. _scipy: https://scipy.org/
223 .. _sparse: https://sparse.pydata.org/en/stable/
224 .. _sqlalchemy: https://www.sqlalchemy.org/
225 .. _tblib: https://python-tblib.readthedocs.io/en/latest/readme.html
226 .. _tiledb: https://github.com/TileDB-Inc/TileDB-Py
227 .. _xxhash: https://github.com/ifduyue/python-xxhash
228 .. _zarr: https://zarr.readthedocs.io/en/stable/index.html