{"record":{"id":"a22b9a945221e554","repo":"mem0ai/mem0","slug":"the-boto3-library-is-required-please-install-it","errorCode":null,"errorMessage":"The 'boto3' library is required. Please install it using 'pip install boto3'.","messagePattern":"The 'boto3' library is required\\. Please install it using 'pip install boto3'\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"mem0/embeddings/aws_bedrock.py","lineNumber":8,"sourceCode":"import json\nimport os\nfrom typing import Literal, Optional\n\ntry:\n    import boto3\nexcept ImportError:\n    raise ImportError(\"The 'boto3' library is required. Please install it using 'pip install boto3'.\")\n\nimport numpy as np\n\nfrom mem0.configs.embeddings.base import BaseEmbedderConfig\nfrom mem0.embeddings.base import EmbeddingBase\n\n\nclass AWSBedrockEmbedding(EmbeddingBase):\n    \"\"\"AWS Bedrock embedding implementation.\n\n    This class uses AWS Bedrock's embedding models.\n    \"\"\"\n\n    def __init__(self, config: Optional[BaseEmbedderConfig] = None):\n        super().__init__(config)\n\n        self.config.model = self.config.model or \"amazon.titan-embed-text-v1\"\n","sourceCodeStart":1,"sourceCodeEnd":26,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0/embeddings/aws_bedrock.py#L1-L26","documentation":"mem0/embeddings/aws_bedrock.py wraps its boto3 import in try/except ImportError and re-raises with install instructions when boto3 is absent. This is a hard import-time failure: merely importing the module (e.g. via mem0's embeddings registry) fails without the AWS SDK. boto3 is an optional dependency, not installed with the core mem0ai package.","triggerScenarios":"Configuring embedder={'provider': 'aws_bedrock'} without pip install boto3; running in a slim Docker image without the AWS SDK; a different virtualenv being active at runtime than at install time.","commonSituations":"CI pipelines installing only requirements.txt that lacks boto3; conda vs pip environment mismatch; local boto3 present but production image missing it.","solutions":["pip install boto3 in the interpreter that runs the app","Add boto3 to your dependency manifest (requirements.txt / pyproject) so deploys install it","For Docker, ensure the RUN pip install step includes boto3 in the final image stage"],"exampleFix":"# before: ImportError raised at import\n\n# after\n# shell:\npip install boto3","handlingStrategy":"validation","validationCode":"try:\n    import boto3  # noqa: F401\nexcept ImportError:\n    raise RuntimeError(\"aws_bedrock embedder requires: pip install boto3\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin boto3 in requirements alongside mem0ai when using aws_bedrock","Run a startup dependency check for every provider you configure"],"tags":["import-error","aws","bedrock","embeddings","dependencies","optional-dependency"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}