{"record":{"id":"7c3d659e3c98bbd9","repo":"apache/beam","slug":"gcs-not-available-please-install-apache-beam-gcp","errorCode":null,"errorMessage":"GCS not available; please install apache_beam[gcp]","messagePattern":"GCS not available; please install apache_beam\\[gcp\\]","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/runners/render.py","lineNumber":528,"sourceCode":"\n  run_server(options)\n\n\ndef render_one(options):\n  if options.pipeline_proto == '-':\n    content = sys.stdin.buffer.read()\n    if content[0] == b'{':\n      ext = '.json'\n    else:\n      try:\n        content.decode('utf-8')\n        ext = '.textproto'\n      except UnicodeDecodeError:\n        ext = '.pb'\n  else:\n    if options.pipeline_proto.startswith('gs://'):\n      if gcsio is None:\n        raise ImportError('GCS not available; please install apache_beam[gcp]')\n      open_fn = gcsio.GcsIO().open\n    else:\n      open_fn = open\n\n    with open_fn(options.pipeline_proto, 'rb') as fin:\n      content = fin.read()\n    ext = os.path.splitext(options.pipeline_proto)[-1]\n\n  if ext == '.textproto':\n    pipeline_proto = text_format.Parse(content, beam_runner_api_pb2.Pipeline())\n  elif ext == '.json':\n    pipeline_proto = json_format.Parse(content, beam_runner_api_pb2.Pipeline())\n  else:\n    pipeline_proto = beam_runner_api_pb2.Pipeline()\n    pipeline_proto.ParseFromString(content)\n\n  RenderRunner().run_portable_pipeline(\n      pipeline_proto, pipeline_options.PipelineOptions(**vars(options)))","sourceCodeStart":510,"sourceCodeEnd":546,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/runners/render.py#L510-L546","documentation":"render_one reads the pipeline proto from --pipeline_proto; if the path is a gs:// URL, it needs the GCS IO module from the apache_beam[gcp] extra. When that optional dependency is absent, it raises ImportError telling the user to install apache_beam[gcp]. Beam keeps GCP support as an optional extra to limit the default install size.","triggerScenarios":"Running the render entry point with --pipeline_proto=gs://bucket/path on an environment where the gcsio module is None (google-cloud-storage not installed).","commonSituations":"Slim virtualenv with only base apache_beam; trying to render a Dataflow-exported proto straight from GCS; container images stripped of GCP extras.","solutions":["pip install apache_beam[gcp] to bring in the GCS dependencies","Download the proto locally (gsutil cp) and point --pipeline_proto at the local file","Verify the installed beam package includes google-cloud-storage (pip show apache-beam)"],"exampleFix":"# before\npip install apache-beam\n--pipeline_proto=gs://my-bucket/pipeline.pb  # ImportError\n# after\npip install 'apache-beam[gcp]'\n--pipeline_proto=gs://my-bucket/pipeline.pb","handlingStrategy":"fallback","validationCode":"from apache_beam.options.pipeline_options import PipelineOptions\nif pipeline_proto.startswith('gs://'):\n    import importlib.util\n    if importlib.util.find_spec('google.cloud.storage') is None:\n        raise SystemExit(\"Run: pip install 'apache_beam[gcp]' to read gs:// protos\")","typeGuard":"def can_read_proto_source(path: str) -> bool:\n    import importlib.util\n    return (not path.startswith('gs://')) or importlib.util.find_spec('apache_beam.io.gcp.internal.gcsio') is not None","tryCatchPattern":"try:\n    render(proto_path)\nexcept ImportError as e:\n    if 'GCS not available' in str(e):\n        subprocess.run(['gsutil', 'cp', proto_path, 'local.pb'], check=True)\n        render('local.pb')  # fallback: local copy\n    else:\n        raise","preventionTips":["Install apache_beam[gcp] wherever pipelines or protos reference gs:// paths","Copy GCS protos locally before rendering in minimal environments","Check optional extras in environment bootstrap scripts"],"tags":["python","apache-beam","gcs","optional-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"}