{"record":{"id":"41b1c3e9c5a492c2","repo":"apache/beam","slug":"google-cloud-dataflow-runner-not-available-please-install-41b1c3","errorCode":null,"errorMessage":"Google Cloud Dataflow runner not available, please install apache_beam[gcp]","messagePattern":"Google Cloud Dataflow runner not available, please install apache_beam\\[gcp\\]","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/runners/dataflow/dataflow_runner.py","lineNumber":373,"sourceCode":"          'Disabling Dataflow Portable Runner no longer supported '\n          'using Beam Python %s.' % beam.version.__version__)\n\n    # Label goog-dataflow-notebook if job is started from notebook.\n    if is_in_notebook():\n      notebook_version = (\n          'goog-dataflow-notebook=' +\n          beam.version.__version__.replace('.', '_'))\n      if options.view_as(GoogleCloudOptions).labels:\n        options.view_as(GoogleCloudOptions).labels.append(notebook_version)\n      else:\n        options.view_as(GoogleCloudOptions).labels = [notebook_version]\n\n    # Import here to avoid adding the dependency for local running scenarios.\n    try:\n      # pylint: disable=wrong-import-order, wrong-import-position\n      from apache_beam.runners.dataflow.internal import apiclient\n    except ImportError:\n      raise ImportError(\n          'Google Cloud Dataflow runner not available, '\n          'please install apache_beam[gcp]')\n\n    _check_and_add_missing_options(options)\n\n    # Convert all side inputs into a form acceptable to Dataflow.\n    if pipeline:\n      pipeline.visit(self.combinefn_visitor())\n\n      pipeline.visit(\n          self.side_input_visitor(\n              deterministic_key_coders=not options.view_as(\n                  TypeOptions).allow_non_deterministic_key_coders))\n\n      # Performing configured PTransform overrides. Note that this is currently\n      # done before Runner API serialization, since the new proto needs to\n      # contain any added PTransforms.\n      pipeline.replace_all(DataflowRunner._PTRANSFORM_OVERRIDES)","sourceCodeStart":355,"sourceCodeEnd":391,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/runners/dataflow/dataflow_runner.py#L355-L391","documentation":"Identical in spirit to error 3400 but raised in DataflowRunner.run_pipeline: submitting a job to Google Cloud Dataflow requires the apiclient module, whose Google Cloud dependencies ship only with the 'apache-beam[gcp]' extra. The import is deferred to job submission so local runs never require those packages.","triggerScenarios":"Calling pipeline.run() with DataflowRunner when google-api-client / related GCP packages are missing, so 'from apache_beam.runners.dataflow.internal import apiclient' raises ImportError.","commonSituations":"Installing plain apache-beam in CI or a container before submitting to Dataflow; deployment images that trimmed the [gcp] extras; switching runners from DirectRunner to DataflowRunner at submit time.","solutions":["pip install 'apache-beam[gcp]' in the submission environment.","Verify the import: python -c \"from apache_beam.runners.dataflow.internal import apiclient\".","If using a constrained image, add the GCP extras to requirements: apache-beam[gcp]==<your-version>.","Use --requirements_file / --save_main_session so worker environments include the same extras."],"exampleFix":"// before\npip install apache-beam\nwith beam.Pipeline(runner='DataflowRunner', options=options) as p: ...\n// after\npip install 'apache-beam[gcp]'\nwith beam.Pipeline(runner='DataflowRunner', options=options) as p: ...","handlingStrategy":"fallback","validationCode":"try:\n    from apache_beam.runners.dataflow.internal import apiclient\n    CAN_SUBMIT_DATAFLOW = True\nexcept ImportError:\n    CAN_SUBMIT_DATAFLOW = False","typeGuard":null,"tryCatchPattern":"try:\n    result = pipeline.run()\nexcept ImportError:\n    result = pipeline_local.run()  # DirectRunner fallback","preventionTips":["Install 'apache-beam[gcp]' in every environment that submits Dataflow jobs","Include the [gcp] extra in Docker images used for submission","Pre-flight import check in the submission script"],"tags":["python","apache-beam","dataflow","missing-dependency","pip"],"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-14T21:17:11.552Z"}