{"record":{"id":"be470c5644eea38d","repo":"apache/beam","slug":"aws-dependencies-are-not-installed-and-no-alternative-client","errorCode":null,"errorMessage":"AWS dependencies are not installed, and no alternative client was provided to S3IO.","messagePattern":"AWS dependencies are not installed, and no alternative client was provided to S3IO\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/io/aws/s3io.py","lineNumber":68,"sourceCode":"  match = re.match('^s3://([^/]+)/(.*)$', s3_path)\n  if match is None or (match.group(2) == '' and not object_optional):\n    raise ValueError('S3 path must be in the form s3://<bucket>/<object>.')\n  return match.group(1), match.group(2)\n\n\nclass S3IO(object):\n  \"\"\"S3 I/O client.\"\"\"\n  def __init__(self, client=None, options=None):\n    if client is None and options is None:\n      raise ValueError('Must provide one of client or options')\n    if client is not None:\n      self.client = client\n    elif BOTO3_INSTALLED:\n      self.client = boto3_client.Client(options=options)\n    else:\n      message = 'AWS dependencies are not installed, and no alternative ' \\\n      'client was provided to S3IO.'\n      raise RuntimeError(message)\n\n  def open(\n      self,\n      filename,\n      mode='r',\n      read_buffer_size=16 * 1024 * 1024,\n      mime_type='application/octet-stream'):\n    \"\"\"Open an S3 file path for reading or writing.\n\n    Args:\n      filename (str): S3 file path in the form ``s3://<bucket>/<object>``.\n      mode (str): ``'r'`` for reading or ``'w'`` for writing.\n      read_buffer_size (int): Buffer size to use during read operations.\n      mime_type (str): Mime type to set for write operations.\n\n    Returns:\n      S3 file object.\n","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/io/aws/s3io.py#L50-L86","documentation":"S3IO.__init__ raises RuntimeError when neither a pre-built client object nor the boto3 dependency is available. The class needs some AWS client to talk to S3; if boto3 is not installed in the environment and the caller did not inject an alternative client, there is no way to construct the IO wrapper.","triggerScenarios":"Instantiating S3IO() (or anything that does so, e.g. s3io.S3IO(options=...)) on a Python environment where apache-beam was installed without the gcp/aws extra and no `client=` argument is passed.","commonSituations":"Slim Docker images or CI runners without boto3; users who installed apache-beam bare (pip install apache-beam) instead of apache-beam[aws]; vendored environments where boto3 was stripped; passing options but forgetting client.","solutions":["Install the AWS extra: pip install 'apache-beam[aws]' (or pip install boto3).","Pass an explicit client: S3IO(client=my_boto3_s3_client, options=options).","Verify installation with python -c \"import boto3\" in the exact interpreter/venv the pipeline runs in.","If boto3 truly cannot be installed, read/write via a different filesystem (e.g. copy out of S3 with the aws CLI first)."],"exampleFix":"# before\nio = s3io.S3IO(options=options)  # RuntimeError: boto3 missing\n# after\npip install 'apache-beam[aws]'\nio = s3io.S3IO(client=boto3.client('s3'), options=options)","handlingStrategy":"validation","validationCode":"try:\n    import boto3  # noqa: F401\nexcept ImportError:\n    raise RuntimeError(\"Install 'apache-beam[aws]' or pass client= to S3IO\")","typeGuard":"def can_use_s3io(client=None):\n    return client is not None or BOTO3_INSTALLED","tryCatchPattern":"try:\n    io = s3io.S3IO(options=options)\nexcept RuntimeError as e:\n    logging.error(\"S3IO unavailable: %s\", e)\n    io = None  # fall back to another filesystem","preventionTips":["Pin 'apache-beam[aws]' in requirements/setup extras.","Smoke-test 'import boto3' in the deployment image build.","Prefer passing an explicit boto3 client in tests."],"tags":["python","aws","missing-dependency","s3"],"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-20T03:17:13.778Z"}