Class PipInstall
A Worker Plugin to pip install a set of packages
Declaration
source linkDocumentation
This accepts a set of packages to install on all workers.
You can also optionally ask for the worker to restart itself after
performing this installation.
.. note::
This will increase the time it takes to start up
each worker. If possible, we recommend including the
libraries in the worker environment or image. This is
primarily intended for experimentation and debugging.
Additional issues may arise if multiple workers share the same
file system. Each worker might try to install the packages
simultaneously.
Attributes
- packages : List[str]
A list of strings to place after "pip install" command
- pip_options : List[str]
Additional options to pass to pip.
- restart : bool, default False
Whether or not to restart the worker after pip installing
Only functions if the worker has an attached nanny process
Examples
>>> from dask.distributed import PipInstall
>>> plugin = PipInstall(packages=["scikit-learn"], pip_options=["--upgrade"])
>>> client.register_worker_plugin(plugin)
Methods
▷ def __init__(self, packages, pip_options=None, restart=False)