{"record":{"id":"db7075562ed09450","repo":"chroma-core/chroma","slug":"the-boto3-python-package-is-not-installed-please","errorCode":null,"errorMessage":"The boto3 python package is not installed. Please install it with `pip install boto3`","messagePattern":"The boto3 python package is not installed\\. Please install it with `pip install boto3`","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"chromadb/utils/embedding_functions/amazon_bedrock_embedding_function.py","lineNumber":93,"sourceCode":"                contentType=content_type,\n            )\n            response_body = json.loads(response.get(\"body\").read())\n            embedding = response_body.get(\"embedding\")\n            embeddings.append(np.array(embedding, dtype=np.float32))\n\n        # Convert to the expected Embeddings type\n        return cast(Embeddings, embeddings)\n\n    @staticmethod\n    def name() -> str:\n        return \"amazon_bedrock\"\n\n    @staticmethod\n    def build_from_config(config: Dict[str, Any]) -> \"EmbeddingFunction[Documents]\":\n        try:\n            import boto3\n        except ImportError:\n            raise ValueError(\n                \"The boto3 python package is not installed. Please install it with `pip install boto3`\"\n            )\n\n        model_name = config.get(\"model_name\")\n        session_args = config.get(\"session_args\")\n        if model_name is None:\n            assert False, \"This code should not be reached\"\n        kwargs = config.get(\"kwargs\", {})\n\n        if session_args is None:\n            session = boto3.Session()\n        else:\n            session = boto3.Session(**session_args)\n\n        return AmazonBedrockEmbeddingFunction(\n            session=session, model_name=model_name, **kwargs\n        )\n","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/chromadb/utils/embedding_functions/amazon_bedrock_embedding_function.py#L75-L111","documentation":"When an amazon_bedrock embedding function is deserialized from a persisted config, build_from_config must create its own boto3.Session (there is no session= argument on this path), so it hard-imports boto3 and re-raises ImportError as this ValueError. boto3 is an optional dependency that `pip install chromadb` does not include. Note the asymmetry: constructing the function directly with a session works without boto3 in some flows, but config round-tripping always requires it.","triggerScenarios":"config_to_embedding_function({\"name\": \"amazon_bedrock\", \"config\": {...}}) — typically inside a server or worker process that rehydrates persisted collection configs — in an environment where boto3 is not installed.","commonSituations":"The process that created the collection had boto3, but the API server / Celery worker / Lambda that later opens the collection does not; fresh deployments missing the aws extra; local venv vs deployed image drift.","solutions":["Install boto3 in the environment that deserializes: pip install boto3.","Add boto3 (and the bedrock provider deps) to the same requirements pin list as chromadb so every runtime that touches these collections has it.","Add a startup dependency check: python -c \"import boto3\" in the deploy healthcheck."],"exampleFix":"# before: server worker raises\n# ValueError \"The boto3 python package is not installed. Please install it with `pip install boto3`\"\nef = config_to_embedding_function(cfg)  # cfg[\"name\"] == \"amazon_bedrock\"\n\n# after: provision deps in the deserializing environment\n# pip install boto3\nimport boto3  # startup check\nef = config_to_embedding_function(cfg)","handlingStrategy":"validation","validationCode":"import importlib.util\n\nif importlib.util.find_spec(\"boto3\") is None:\n    raise RuntimeError(\"boto3 is required to deserialize amazon_bedrock configs; run: pip install boto3\")\n\nfrom chromadb.utils.embedding_functions import config_to_embedding_function\nef = config_to_embedding_function(cfg)","typeGuard":null,"tryCatchPattern":"from chromadb.utils.embedding_functions import config_to_embedding_function\ntry:\n    ef = config_to_embedding_function(cfg)\nexcept ValueError as e:\n    if \"boto3\" in str(e):\n        raise RuntimeError(\"Install boto3 in this environment before loading bedrock collections\") from e\n    raise","preventionTips":["List boto3 in the same dependency set as chromadb for any service that opens bedrock collections.","Add import probes for optional providers (boto3, openai, fastembed) to container healthchecks.","Keep writer and reader environments in sync via one shared lockfile."],"tags":["python","aws","boto3","bedrock","optional-dependency","deserialization","chromadb"],"backgroundTag":"missing-optional-dependency","analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}