{"record":{"id":"18fee9a8f18d6204","repo":"crewAIInc/crewAI","slug":"boto3-package-not-found-please-run-uv-add-boto","errorCode":null,"errorMessage":"`boto3` package not found, please run `uv add boto3`","messagePattern":"`boto3` package not found, please run `uv add boto3`","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"lib/crewai-tools/src/crewai_tools/aws/bedrock/agents/invoke_agent_tool.py","lineNumber":97,"sourceCode":"                raise BedrockValidationError(\"agent_id must be a string\")\n\n            if not self.agent_alias_id:\n                raise BedrockValidationError(\"agent_alias_id cannot be empty\")\n            if not isinstance(self.agent_alias_id, str):\n                raise BedrockValidationError(\"agent_alias_id must be a string\")\n\n            if self.session_id and not isinstance(self.session_id, str):\n                raise BedrockValidationError(\"session_id must be a string\")\n\n        except BedrockValidationError as e:\n            raise BedrockValidationError(f\"Parameter validation failed: {e!s}\") from e\n\n    def _run(self, query: str) -> str:\n        try:\n            import boto3\n            from botocore.exceptions import ClientError\n        except ImportError as e:\n            raise ImportError(\n                \"`boto3` package not found, please run `uv add boto3`\"\n            ) from e\n\n        try:\n            # Initialize the Bedrock Agent Runtime client\n            bedrock_agent = boto3.client(\n                \"bedrock-agent-runtime\",\n                region_name=os.getenv(\n                    \"AWS_REGION\", os.getenv(\"AWS_DEFAULT_REGION\", \"us-west-2\")\n                ),\n            )\n\n            current_utc = datetime.now(timezone.utc)\n            prompt = f\"\"\"\nThe current time is: {current_utc}\n\nBelow is the users query or task. Complete it and answer it consicely and to the point:\n{query}","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai-tools/src/crewai_tools/aws/bedrock/agents/invoke_agent_tool.py#L79-L115","documentation":"An ImportError raised in _run when `import boto3` (or botocore.exceptions) fails, meaning the AWS SDK is not installed in the current environment. The tool imports boto3 lazily at run time instead of install time, so the error surfaces only when the agent first invokes the tool.","triggerScenarios":"Running the Bedrock agent tool in an environment where boto3 is absent — the try/except around `import boto3` / `from botocore.exceptions import ClientError` catches ImportError and re-raises with the install hint.","commonSituations":"Fresh virtualenv with only crewai-tools core deps; Docker images that trimmed AWS deps; team members who installed with `pip install crewai-tools` without the aws extra; CI runners caching an old env.","solutions":["Install the SDK: `uv add boto3` (message's own hint), or `pip install boto3`.","Prefer the packaged extra if available so the dep is declared: `uv add 'crewai-tools[aws]'` / requirements pin boto3>=1.34.","Verify before deploying: `python -c \"import boto3; print(boto3.__version__)\"`."],"exampleFix":"# shell — before: ImportError\n# after\nuv add boto3\n# or pin in pyproject.toml dependencies: \"boto3>=1.34.0\"","handlingStrategy":"validation","validationCode":"try:\n    import boto3  # noqa\nexcept ImportError:\n    raise SystemExit(\"boto3 missing — run `uv add boto3` before using Bedrock tools\")","typeGuard":"def boto3_available() -> bool:\n    try:\n        import boto3  # noqa: F401\n        return True\n    except ImportError:\n        return False","tryCatchPattern":"try:\n    result = tool._run(query)\nexcept ImportError as e:\n    if \"boto3\" in str(e):\n        raise SystemExit(\"Install boto3: uv add boto3\") from e\n    raise","preventionTips":["Declare boto3 explicitly in your project dependencies; do not rely on the tool to prompt.","Add a container/CI step that imports boto3 before running crews with AWS tools.","Pin boto3>=1.34 (Bedrock Agents GA API surface)."],"tags":["aws","bedrock","dependency","import-error"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}