{"record":{"id":"8f99f681305d8e2d","repo":"apache/beam","slug":"gcp-dependencies-are-not-installed-cannot-use-dicomsearch","errorCode":null,"errorMessage":"GCP dependencies are not installed. Cannot use DicomSearch. Please install using 'pip install apache-beam[gcp]'.","messagePattern":"GCP dependencies are not installed\\. Cannot use DicomSearch\\. Please install using 'pip install apache-beam\\[gcp\\]'\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/yaml/yaml_io.py","lineNumber":987,"sourceCode":"\n    - result (str): JSON-encoded list of matching DICOM resources.\n    - status (str): HTTP status from the DICOM API.\n    - input (str): JSON-encoded copy of the search request.\n\n  Failed searches raise unless ``error_handling`` is set, in which case they\n  are routed to the configured error output.\n\n  Args:\n    buffer_size: Number of requests to buffer before flushing.\n    max_workers: Maximum number of threads used to issue requests.\n    error_handling: If specified, should be a mapping giving an output into\n      which to emit failed searches, as described at\n      https://beam.apache.org/documentation/sdks/yaml-errors/\n  \"\"\"\n  try:\n    from apache_beam.io.gcp.healthcare.dicomio import DicomSearch\n  except ImportError as exn:\n    raise ValueError(\n        \"GCP dependencies are not installed. Cannot use DicomSearch. \"\n        \"Please install using 'pip install apache-beam[gcp]'.\") from exn\n\n  def row_to_dict(value):\n    if value is None:\n      return None\n    if hasattr(value, '_asdict'):\n      return {k: row_to_dict(v) for k, v in value._asdict().items()}\n    elif hasattr(value, 'as_dict'):\n      return {k: row_to_dict(v) for k, v in value.as_dict().items()}\n    elif isinstance(value, (list, tuple)):\n      return [row_to_dict(v) for v in value]\n    elif isinstance(value, Mapping):\n      return {k: row_to_dict(v) for k, v in value.items()}\n    else:\n      return value\n\n  def normalize_request(value):","sourceCodeStart":969,"sourceCodeEnd":1005,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/yaml/yaml_io.py#L969-L1005","documentation":"Raised by dicom_search in apache_beam/yaml/yaml_io.py when the DicomSearch transform is used but `from apache_beam.io.gcp.healthcare.dicomio import DicomSearch` fails, meaning the GCP extra dependencies of apache-beam are not installed.","triggerScenarios":"Using the YAML dicom_search transform with a base apache-beam install (no [gcp] extra) or in an environment where google-api-client/google-cloud-healthcare deps are absent.","commonSituations":"Lightweight CI/containers with apache-beam installed without extras; switching from local testing to a GCP-backed pipeline without updating requirements; missing extras in requirements.txt.","solutions":["Run pip install 'apache-beam[gcp]' in the environment executing the pipeline.","Add apache-beam[gcp] to requirements.txt/setup.py extras for the project.","Confirm the import works: python -c \"from apache_beam.io.gcp.healthcare.dicomio import DicomSearch\"."],"exampleFix":"// before\npip install apache-beam\n// after\npip install 'apache-beam[gcp]'","handlingStrategy":"validation","validationCode":"try:\n    from apache_beam.io.gcp.healthcare.dicomio import DicomSearch\nexcept ImportError:\n    raise SystemExit(\"run: pip install 'apache-beam[gcp]'\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always install GCP-dependent pipelines with apache-beam[gcp]","Pin apache-beam[gcp] in requirements.txt","Smoke-test imports in CI before deploying the pipeline"],"tags":["apache-beam","yaml","gcp","dependencies"],"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"}