[Bug] 1.11.0 fails to import on fresh install: bedrock_agentcore.evaluation triggers ModuleNotFoundError: No module named 'requests'
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- python
- 領域
- build-system
調査の方向性
まずクリーンな仮想環境で再現手順を実行し、その後 pyproject.toml と src/bedrock_agentcore/evaluation/runner/dataset_providers.py、および evaluation entry points にある eager imports を調査します。既存のパッケージ設定に照らして、選択した依存関係または import の挙動を確認します。新規インストール後に requests を手動で追加せず、bedrock_agentcore.evaluation の import が成功すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
[Bug] 1.11.0 fails to import on fresh install: bedrock_agentcore.evaluation triggers ModuleNotFoundError: No module named 'requests'
Summary
After installing bedrock-agentcore==1.11.0 from PyPI into a clean virtual environment, importing anything from bedrock_agentcore.evaluation fails with ModuleNotFoundError: No module named 'requests'. The new file src/bedrock_agentcore/evaluation/runner/dataset_providers.py (added in #491) does import requests at module load, but requests is not declared in the package's runtime dependencies — only in [dependency-groups.dev].
The runtime path (bedrock_agentcore.runtime) is unaffected, so the issue is scoped to the evaluation submodule.
Reproduction
python3.12 -m venv /tmp/repro && source /tmp/repro/bin/activate
pip install bedrock-agentcore==1.11.0
python -c "from bedrock_agentcore.evaluation import EvaluatorInput"
Output:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File ".../site-packages/bedrock_agentcore/evaluation/__init__.py", line 10, in <module>
from bedrock_agentcore.evaluation.runner.batch.batch_evaluation_models import (
File ".../site-packages/bedrock_agentcore/evaluation/runner/__init__.py", line 3, in <module>
from .dataset_providers import DatasetProvider, FileDatasetProvider
File ".../site-packages/bedrock_agentcore/evaluation/runner/dataset_providers.py", line 7, in <module>
import requests
ModuleNotFoundError: No module named 'requests'
Root cause
In pyproject.toml at v1.11.0, requests only appears in the dev-tools group:
[project]
dependencies = [
"boto3>=1.43.0",
"botocore>=1.43.0",
"pydantic>=2.0.0,<2.41.3",
"urllib3>=1.26.0",
"starlette>=0.46.2",
"typing-extensions>=4.13.2,<5.0.0",
"uvicorn>=0.34.2",
"websockets>=12.0",
] # ← no `requests` here
[dependency-groups]
dev = [
"httpx>=0.28.1",
"moto>=5.1.6", # transitively pulls in requests in dev environments
...
]
But src/bedrock_agentcore/evaluation/runner/dataset_providers.py line 7 imports it at the top of the module:
"""Dataset provider implementations for loading evaluation datasets."""
import json
from abc import ABC, abstractmethod
from typing import Any, Dict, List, Optional
import requests # ← runs on module load; runtime dep not declared
from bedrock_agentcore.evaluation.dataset_client import DatasetClient
...
Because evaluation/runner/__init__.py eagerly imports dataset_providers, and evaluation/__init__.py eagerly imports the runner, the failure surfaces on any first-touch of bedrock_agentcore.evaluation.*.
This was masked in CI / local development because moto (a dev-group dep) transitively installs requests, so it's already on the path inside the project's own venv.
Suggested fix
Either of:
Option A — declare the runtime dep
dependencies = [
...,
"requests>=2.31",
]
Option B — make the import lazy (consistent with bedrock_agentcore/identity/auth.py:155, where import requests is already inside a function body)
class FileDatasetProvider(DatasetProvider):
def fetch(self, url: str) -> ...:
import requests
return requests.get(url)
Option B is cleaner if requests is only used by FileDatasetProvider-like loaders — users who never load datasets from a remote URL wouldn't pay the dependency cost.
Environment
bedrock-agentcore==1.11.0(from PyPI, fresh install, no other packages)- Python 3.12.12
- macOS 25.4 /
uv0.11.6 (also reproduces withpipper the steps above) - Released 2026-05-22 ~15:27 UTC, no fix on
mainas of 2026-05-24
Workaround for downstream consumers
Until 1.11.1 ships, downstreams need to either pin bedrock-agentcore<1.11 or declare requests as a direct dep in their own package. We've taken the pin route in our internal eval wheel since we don't yet use any of the new DatasetClient / DatasetManagementServiceProvider symbols added in 1.11.0.
Related
- PR #491 (the change that introduced the eager top-level
import requests)
- 主要言語
- Python
- スター
- 777
- フォーク
- 155
- 平均マージ
- 1日 12時間
- マージ済み PR(30日)
- 14
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
aws/bedrock-agentcore-sdk-python のほかの issue
-
AgentCoreMemorySessionManager discards the two boto3 clients MemoryClient builds; boto_session and boto_client_config are not passed through対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
aws/bedrock-agentcore-sdk-python#681 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug high-severity
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
aws/bedrock-agentcore-sdk-python#680 ·
メンテナーはふだん 1 日以内に返信
-
[Bug] update_message fails with parameter validation error when SessionMessage.message_id is a Strands positional integer index対応中かも @citizen204 が 107 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
aws/bedrock-agentcore-sdk-python#556 ·
メンテナーはふだん 1 日以内に返信
-
CodeInterpreter should not require a region argument対応中かも @citizen204 が 121 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
aws/bedrock-agentcore-sdk-python#511 ·
メンテナーはふだん 1 日以内に返信
-
Pydantic deprecation warning: Support for class-based `config` is deprecated, use ConfigDict instead対応中かも @citizen204 が 121 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
aws/bedrock-agentcore-sdk-python#320 · コメント 2 件 · リアクション 3 件 ·
メンテナーはふだん 1 日以内に返信
aws/bedrock-agentcore-sdk-python の issue をすべて見る
似ている issue
-
md/asciidoc/csv: an explicit `encoding="utf-8"` keeps a leading BOM, the auto-detect path drops itオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
docling-project/docling#4846 ·
メンテナーはふだん 1 日以内に返信
-
area/sessions comp/dashboard comp/desktop comp/gateway comp/tui duplicate P2 sweeper:risk-session-state type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NousResearch/hermes-agent#138914 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bot-triaged module: activation checkpointing module: inductor oncall: pt2 triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
[oblt-aw][autodoc] Update PR Actions Detective E2E prerequisites and fix dashboard-format table typoオープンdocumentation
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
elastic/oblt-aw#2382 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信