Install & Compatibility
Where this runs
tested against v1.43.65 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.782s · 117.1MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 6.1s · import 0.708s · 115MB
115MB installed
● package 115MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ECSClient
✓ from mypy_boto3_ecs.client import ECSClient
ECSResource
✓ from mypy_boto3_ecs.service_resource import ECSResource
ListClustersPaginator
✓ from mypy_boto3_ecs.paginator import ListClustersPaginator
Paginators are service-specific and located in the `paginator` submodule.
This example demonstrates how to use `mypy-boto3-ecs` with `boto3` to gain static type checking for the ECS client. The `TYPE_CHECKING` block ensures that type-specific imports do not affect runtime behavior. You need to run `mypy your_script.py` to see the benefits.
import boto3
from mypy_boto3_ecs.client import ECSClient
from typing import TYPE_CHECKING
# Ensure boto3 is installed: pip install boto3 mypy-boto3-ecs
if TYPE_CHECKING:
# This block is only for type checking, not runtime execution
client: ECSClient = boto3.client("ecs")
# Example usage with type hints
response = client.list_clusters()
for cluster in response.get("clusters", []):
print(f"Cluster ARN: {cluster.get('clusterArn')}")
else:
# Runtime code without explicit type hints (mypy will still check)
client = boto3.client("ecs")
response = client.list_clusters()
for cluster in response.get("clusters", []):
print(f"Cluster Name: {cluster.get('clusterName')}")
Debug
Known issues
breakingPython 3.8 support has been removed for all `mypy-boto3` packages with `mypy-boto3-builder` version 8.12.0 and above. Ensure your environment uses Python 3.9 or higher.fixUpgrade your Python environment to 3.9 or newer.
affects: mypy-boto3-builder >= 8.12.0 (affecting mypy-boto3-ecs 1.42.88+)
gotcha`mypy-boto3-ecs` provides only type stubs. You must install `boto3` separately for your code to run. It's a common mistake to install only the stub package.fixAlways `pip install boto3 mypy-boto3-ecs` (or `aiobotocore`/`aioboto3` for async stubs).
affects: All versions
breakingTypeDef naming conventions changed in `mypy-boto3-builder` 8.9.0. Specifically, argument TypeDefs use shorter names, and conflicting TypeDef `Extra` postfixes were moved. This might require updating type annotation references in your codebase.fixReview `mypy` errors and adjust TypeDef names (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`).
affects: mypy-boto3-builder >= 8.9.0 (affecting mypy-boto3-ecs versions generated by this builder version)
gotchaThe `mypy-boto3` stub packages, including `mypy-boto3-ecs`, migrated to PEP 561 compliance with `mypy-boto3-builder` 8.12.0. While this is an improvement for type checker discovery, some legacy tools or build systems might need minor adjustments.fixEnsure your type checker (e.g., mypy) is up-to-date. No direct code changes are typically required unless you have specific, custom stub loading configurations.
affects: mypy-boto3-builder >= 8.12.0 (affecting mypy-boto3-ecs 1.42.88+)
gotchaThese stubs are designed for use with `mypy`. While other type checkers might work, `mypy` is the primary target and often yields the most accurate results.fixUse `mypy` for type checking. Install with `pip install mypy` and run `mypy your_script.py`.
affects: All versions
Upgrade
Version history
1.43.65latest on PyPI · released Aug 5, 2026
Audit
Dependencies
boto3requiredThis package provides type stubs for boto3; boto3 itself must be installed to run the code.
mypyrequiredmypy is required to perform static type checking using these stubs.