{"record":{"id":"b6b6baea97bb3b85","repo":"apache/beam","slug":"google-cloud-video-intelligence-not-supported-for-this","errorCode":null,"errorMessage":"Google Cloud Video Intelligence not supported for this execution environment (could not import google.cloud.videointelligence).","messagePattern":"Google Cloud Video Intelligence not supported for this execution environment \\(could not import google\\.cloud\\.videointelligence\\)\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/ml/gcp/videointelligenceml.py","lineNumber":34,"sourceCode":"#\n\n\"\"\"A connector for sending API requests to the GCP Video Intelligence API.\"\"\"\n\nfrom typing import Optional\nfrom typing import Union\n\nfrom cachetools.func import ttl_cache\n\nfrom apache_beam import typehints\nfrom apache_beam.metrics import Metrics\nfrom apache_beam.transforms import DoFn\nfrom apache_beam.transforms import ParDo\nfrom apache_beam.transforms import PTransform\n\ntry:\n  from google.cloud import videointelligence\nexcept ImportError:\n  raise ImportError(\n      'Google Cloud Video Intelligence not supported for this execution '\n      'environment (could not import google.cloud.videointelligence).')\n\n__all__ = ['AnnotateVideo', 'AnnotateVideoWithContext']\n\n\n@ttl_cache(maxsize=128, ttl=3600)\ndef get_videointelligence_client():\n  \"\"\"Returns a Cloud Video Intelligence client.\"\"\"\n  _client = videointelligence.VideoIntelligenceServiceClient()\n  return _client\n\n\nclass AnnotateVideo(PTransform):\n  \"\"\"A ``PTransform`` for annotating video using the GCP Video Intelligence API\n  ref: https://cloud.google.com/video-intelligence/docs\n\n  Sends each element to the GCP Video Intelligence API. Element is a","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/ml/gcp/videointelligenceml.py#L16-L52","documentation":"Module-level guard in videointelligenceml.py: the google.cloud.videointelligence client library is not installed in this execution environment, so the AnnotateVideo connector cannot be imported at all.","triggerScenarios":"Thrown at sdks/python/apache_beam/ml/gcp/videointelligenceml.py:34 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["pip install google-cloud-videointelligence","Or install the bundled extra: pip install 'apache_beam[gcp]'"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}