-
Notifications
You must be signed in to change notification settings - Fork 110
Description
Describe the bug
When running agentcore launch on Windows with uv for dependency management, the CLI attempts to install Linux ARM64 dependencies using the existing Windows virtual environment's Python interpreter. This causes dependency resolution to fail for platform-specific packages like pywin32, which only has Windows wheels but is being resolved for Linux ARM64 deployment.
To Reproduce
Steps to reproduce the behavior:
- Set up a project on Windows (Intel x64) with
uvandpyproject.toml - Create a virtual environment with
uv sync(creates.venvwith Windows Python interpreter) - Configure AgentCore for Linux ARM64 deployment (
platform: linux/arm64in.bedrock_agentcore.yaml) - Run command:
uv run agentcore launch --agent rpg_tools - See error during "Installing dependencies with uv for aarch64-manylinux_2_28"
Expected behavior
The CLI should create a separate temporary environment or use uv's cross-platform resolution capabilities to install dependencies for the target platform (Linux ARM64) without requiring the local development environment's Python interpreter. Platform-specific dependencies like pywin32 (which has marker = "sys_platform == 'win32'" in uv.lock) should be automatically excluded when building for Linux.
Error Output
Building dependencies for Linux ARM64 Runtime (manylinux2014_aarch64)
...
❌ Failed to install dependencies with uv: Using CPython 3.12.8 interpreter at:
.venv\Scripts\python.exe
× No solution found when resolving dependencies:
╰─▶ Because pywin32==311 has no wheels with a matching platform tag (e.g.,
`manylinux_2_28_aarch64`) and you require pywin32==311, we can conclude
that your requirements are unsatisfiable.
hint: Wheels are available for `pywin32` (v311) on the following
platforms: `win32`, `win_amd64`, `win_arm64`
Environment:
- OS: Windows 11 (Intel x64)
- Python version: 3.12.8
- uv version: 0.9.16
- bedrock-agentcore version: >=1.1.1
- Installation method: uv
Additional context
The uv.lock file correctly includes platform markers for pywin32:
{ name = "pywin32", marker = "sys_platform == 'win32'" }
This indicates that pywin32 should only be installed on Windows platforms. However, the AgentCore CLI appears to be calling uv pip install with the Windows .venv Python interpreter (.venv\Scripts\python.exe) while trying to target Linux ARM64, which causes uv to attempt installing all locked dependencies including pywin32 for the wrong platform.
The issue occurs because:
- Local development requires a Windows virtual environment to run the AgentCore CLI
- The CLI reuses this Windows venv's Python interpreter for cross-platform dependency installation
uvcannot resolve platform-specific dependencies when the interpreter platform doesn't match the target platform
Suggested fix:
The CLI should either:
- Use
uv export --python-platform manylinux_2_28_aarch64to generate a platform-specific requirements file, then install to target directory - Use
uv sync --python-platform linuxif available (uv >=0.5.0) - Create a temporary isolated environment with correct platform specification
- Parse
uv.lockdirectly and filter dependencies by platform markers