{"record":{"id":"4dda2d1132ace0b4","repo":"apache/beam","slug":"daskrunner-is-not-available-please-install-apache-beam-dask","errorCode":null,"errorMessage":"DaskRunner is not available. Please install apache_beam[dask].","messagePattern":"DaskRunner is not available\\. Please install apache_beam\\[dask\\]\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/runners/dask/dask_runner.py","lineNumber":235,"sourceCode":"        self.bags[transform_node] = op.apply(**op_kws)\n\n    return DaskBagVisitor()\n\n  @staticmethod\n  def is_fnapi_compatible():\n    return False\n\n  def run_pipeline(self, pipeline, options):\n    import dask\n\n    # TODO(alxmrs): Create interactive notebook support.\n    if is_in_notebook():\n      raise NotImplementedError('interactive support will come later!')\n\n    try:\n      import dask.distributed as ddist\n    except ImportError:\n      raise ImportError(\n          'DaskRunner is not available. Please install apache_beam[dask].')\n\n    dask_options = options.view_as(DaskOptions).get_all_options(\n        drop_default=True, current_only=True)\n    bag_kwargs = DaskOptions._extract_bag_kwargs(dask_options)\n    client = ddist.Client(**dask_options)\n\n    pipeline.replace_all(dask_overrides())\n\n    dask_visitor = self.to_dask_bag_visitor(bag_kwargs)\n    pipeline.visit(dask_visitor)\n    # The dictionary in this visitor keeps a mapping of every Beam\n    # PTransform to the equivalent Bag operation. This is highly\n    # redundant. Thus, we can get away with computing just the last\n    # value, which should be connected to the full Bag Task Graph.\n    opt_graph = dask.optimize(list(dask_visitor.bags.values())[-1])\n    futures = client.compute(opt_graph)\n    return DaskRunnerResult(client, futures)","sourceCodeStart":217,"sourceCodeEnd":253,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/runners/dask/dask_runner.py#L217-L253","documentation":"DaskRunner.run_pipeline could not import dask.distributed, meaning the Dask scheduler extra is not installed in this environment; the runner cannot launch workers and fails fast with install instructions.","triggerScenarios":"Running a pipeline with DaskRunner in an environment where `import dask.distributed` fails (dask/distributed not installed).","commonSituations":"CI or production environments where only the base apache-beam package was pip-installed, without the [dask] extra.","solutions":["Install the extra: `pip install apache-beam[dask]`.","Or install dask and distributed separately: `pip install dask distributed`.","Pin compatible versions of dask/distributed if apache-beam's extra resolves a too-new version."],"exampleFix":"// before\npip install apache-beam\n// after\npip install \"apache-beam[dask]\"","handlingStrategy":"validation","validationCode":"try:\n    import dask.distributed  # noqa\nexcept ImportError:\n    raise SystemExit('Install apache_beam[dask] to use DaskRunner')","typeGuard":"def dask_available() -> bool:\n    try:\n        import dask.distributed  # noqa: F401\n        return True\n    except ImportError:\n        return False","tryCatchPattern":"try:\n    with beam.Pipeline(runner='DaskRunner', options=opts) as p:\n        ...\nexcept ImportError as e:\n    logging.error('%s; run: pip install apache-beam[dask]', e)","preventionTips":["Install apache-beam[dask] wherever DaskRunner is used.","Add an import check to CI before running Dask pipelines.","Document runner dependencies in your deploy manifests."],"tags":["python","apache-beam","dask","import-error","dependency"],"backgroundTag":"missing-optional-dependency","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}