{"record":{"id":"84b1a1d6a08fa05a","repo":"mem0ai/mem0","slug":"the-boto3-library-is-required-please-install-it-84b1a1","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/vector_stores/s3_vectors.py","lineNumber":13,"sourceCode":"import json\nimport logging\nfrom typing import Dict, List, Optional\n\nfrom pydantic import BaseModel\n\nfrom mem0.vector_stores.base import VectorStoreBase\n\ntry:\n    import boto3\n    from botocore.exceptions import ClientError\nexcept ImportError:\n    raise ImportError(\"The 'boto3' library is required. Please install it using 'pip install boto3'.\")\n\nlogger = logging.getLogger(__name__)\n\n\nclass OutputData(BaseModel):\n    id: Optional[str]\n    score: Optional[float]\n    payload: Optional[Dict]\n\n\nclass S3Vectors(VectorStoreBase):\n    def __init__(\n        self,\n        vector_bucket_name: str,\n        collection_name: str,\n        embedding_model_dims: int,\n        distance_metric: str = \"cosine\",\n        region_name: Optional[str] = None,","sourceCodeStart":1,"sourceCodeEnd":31,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0/vector_stores/s3_vectors.py#L1-L31","documentation":"Raised at import time when boto3 (which pulls in botocore, needed for ClientError handling) is absent. S3 Vectors access is via the AWS SDK, which mem0 treats as an optional dependency, so importing mem0.vector_stores.s3_vectors in a bare environment fails before the class is defined.","triggerScenarios":"`from mem0.vector_stores.s3_vectors import S3Vectors` or `\"vector_store\": {\"provider\": \"s3_vectors\"}` in any environment where `import boto3` raises ImportError.","commonSituations":"Base `mem0ai` install used with the s3_vectors provider; Lambda/container images stripped of boto3 to save size; CI matrices that install only per-provider extras; local dev on machines without AWS tooling.","solutions":["Install it: `pip install boto3` in the runtime environment.","Add boto3 (and any AWS extras like boto3-stubs for type checking) to the deployment requirements.","Verify with `python -c \"import boto3; print(boto3.__version__)\"` if the error persists — usually a venv mismatch."],"exampleFix":"# before\nfrom mem0.vector_stores.s3_vectors import S3Vectors  # ImportError\n\n# after\n# pip install boto3\nfrom mem0.vector_stores.s3_vectors import S3Vectors  # ok","handlingStrategy":"try-catch","validationCode":"import importlib.util\n\nif importlib.util.find_spec(\"boto3\") is None:\n    raise SystemExit(\"Missing dependency: boto3. Run: pip install boto3\")","typeGuard":null,"tryCatchPattern":"try:\n    from mem0.vector_stores.s3_vectors import S3Vectors\nexcept ImportError as e:\n    raise RuntimeError(f\"AWS SDK not installed: {e}. Required for the s3_vectors provider.\") from e","preventionTips":["Include boto3 in the base image for any service that may use AWS-backed stores.","Add a startup dependency probe for optional providers.","Beware slim container images that strip boto3 — it is often assumed present but excluded."],"tags":["dependencies","aws","s3-vectors","import-error","installation","vector-store"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}