Install & Compatibility
Where this runs
tested against v1.43.0 · 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.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 20.1MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 3.4s · import 0.000s · 21MB
18MB installed
● package 18MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ComprehendClient
✓ from mypy_boto3_comprehend import ComprehendClient
✗ from mypy_boto3_comprehend import ComprehendClient
This example demonstrates how to obtain a Comprehend client with and without explicit type annotations. Explicitly typing the client with `ComprehendClient` from `mypy_boto3_comprehend` provides full type checking and autocompletion for `boto3` operations on the Comprehend service.
import boto3
from mypy_boto3_comprehend import ComprehendClient
from typing import TYPE_CHECKING
# Boto3 client without explicit typing (type checkers may infer correctly)
client = boto3.client("comprehend")
client.detect_dominant_language(Text="Hello, this is a test.")
# Explicit typing for better IDE support and type checking
if TYPE_CHECKING:
# In a real scenario, use actual AWS credentials
# or ensure they are configured via environment variables or ~/.aws/credentials
session = boto3.Session(region_name='us-east-1') # Or any appropriate region
typed_client: ComprehendClient = session.client("comprehend")
response = typed_client.detect_dominant_language(Text="Hola, esto es una prueba.")
print(response['Languages'][0]['LanguageCode'])
Debug
Known issues
breakingPython 3.8 support has been removed across all `mypy-boto3-*` packages, including `mypy-boto3-comprehend`. Projects must use Python 3.9 or newer.fixUpgrade your Python environment to 3.9 or a later version.
affects: mypy-boto3-builder 8.12.0 and newer (affecting mypy-boto3-comprehend 1.42.3 and newer)
breakingAll `mypy-boto3-*` packages, including this one, migrated to PEP 561 compliant distribution. While this is a standard, older toolchains or custom stub paths might require adjustments.fixEnsure your `mypy` or `pyright` configuration and environment are up-to-date and correctly discover PEP 561 stubs. Typically no manual fix is needed for modern setups.
affects: mypy-boto3-builder 8.12.0 and newer (affecting mypy-boto3-comprehend 1.42.3 and newer)
gotchaThis package provides *only* type annotations. The `boto3` library itself must be installed in your environment for the code to run. Installing `mypy-boto3-comprehend` does not install `boto3`.fixEnsure `pip install boto3` is executed in your project's environment alongside this stub package.
affects: All versions
gotchaPyCharm users may experience slow performance or high CPU usage with `boto3-stubs` packages (which `mypy-boto3-comprehend` is part of, or can be installed as an extra). This is due to PyCharm's internal type checker handling of Literal overloads.fixConsider using `boto3-stubs-lite` instead (e.g., `pip install 'boto3-stubs-lite[comprehend]'`), disabling PyCharm's internal type checker and relying on `mypy` or `pyright` directly, or explicitly typing `session.client()` and `session.resource()` calls.
affects: All versions
Upgrade
Version history
1.43.0latest on PyPI · released Apr 29, 2026
Audit
Dependencies
boto3requiredProvides the AWS SDK runtime library that these type annotations are for. Must be installed separately.
mypyoptionalStatic type checker to utilize these annotations. Alternatively, pyright or an IDE with type checking support can be used.