Install & Compatibility
Where this runs
tested against v1.43.21 · 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.000s · 18.4MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 19MB
16MB installed
● package 16MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
LocationServiceRoutesV2Client
✓ from mypy_boto3_geo_routes import LocationServiceRoutesV2Client
✗ from mypy_boto3_geo_routes import LocationServiceRoutesV2Client
Client
✓ from mypy_boto3_geo_routes.client import LocationServiceRoutesV2Client
✗ from mypy_boto3_geo_routes import LocationServiceRoutesV2Client
ServiceResource
✓ from mypy_boto3_geo_routes.service_resource import LocationServiceRoutesV2ServiceResource
Demonstrates initializing a type-hinted AWS LocationServiceRoutesV2 client and performing a basic `calculate_route` operation. Note that `mypy-boto3-geo-routes` provides only type stubs; the actual `boto3` library must be installed and configured for runtime execution with valid AWS credentials.
import boto3
from mypy_boto3_location_service_routes_v2 import LocationServiceRoutesV2Client
from mypy_boto3_location_service_routes_v2.type_defs import CalculateRouteRequestRequestTypeDef
# Ensure AWS credentials are configured (e.g., via environment variables or ~/.aws/credentials)
# Initialize the boto3 client with type annotations
client: LocationServiceRoutesV2Client = boto3.client("location-service-routes-v2")
# Example: Calculate a route. Replace with actual data and coordinates.
# For a full list of parameters, refer to AWS Boto3 documentation.
request_params: CalculateRouteRequestRequestTypeDef = {
"CalculatorName": "ExampleRouteCalculator", # Must be an existing calculator name in your AWS account
"DeparturePosition": [10.0, 20.0], # Example: [longitude, latitude]
"DestinationPosition": [11.0, 21.0], # Example: [longitude, latitude]
"TravelMode": "Car",
"DepartureTime": "2024-01-01T00:00:00Z" # ISO 8601 format
}
try:
response = client.calculate_route(**request_params)
print(f"Calculated Route Summary: {response['Summary']}")
# Example output: Calculated Route Summary: {'DataSource': 'Esri', 'Distance': 1.23, 'DurationSeconds': 60.0}
except client.exceptions.ResourceNotFoundException as e:
print(f"Error: {e}. Ensure 'ExampleRouteCalculator' exists and is correctly configured in AWS Location Service.")
except Exception as e:
print(f"An unexpected error occurred: {e}")
Debug
Known issues
breakingPython 3.8 support was removed for `mypy-boto3` packages with `mypy-boto3-builder` version 8.12.0. Users on Python 3.8 will need to upgrade to Python 3.9 or newer to use current versions of these stubs.fixUpgrade your Python environment to 3.9 or later.
affects: >=8.12.0 (builder)
breakingTypeDef naming conventions changed in `mypy-boto3-builder` 8.9.0. Some TypeDef names were shortened (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`). This can break explicit type annotations in existing code.fixReview and update explicit TypeDef annotations in your code to match the new shorter names, if affected.
affects: >=8.9.0 (builder)
gotchaThis package provides type stubs only. It requires the actual `boto3` library to be installed and configured for runtime execution. For optimal type checking and to avoid potential runtime issues, ensure your `mypy-boto3-geo-routes` stub version is compatible with your installed `boto3` version.fixEnsure `pip install boto3` is run. Ideally, `mypy-boto3-geo-routes` version (e.g., 1.42.81) should correspond to your `boto3` version (e.g., `boto3==1.42.81`).
affects: *
gotchaThe `mypy-boto3` packages migrated to PEP 561 standard distribution in builder version 8.12.0. While this is generally an improvement, some `mypy` configurations or build environments might require adjustments if issues with stub discovery arise after upgrading.fixIf type checking issues occur after upgrading, consult `mypy` documentation and `mypy-boto3` GitHub for potential configuration changes, especially regarding `py.typed` files.
affects: >=8.12.0 (builder)
gotchaWhen importing specific client or resource types, always import from the dedicated `mypy_boto3_SERVICE_NAME` package (e.g., `from mypy_boto3_location_service_routes_v2 import LocationServiceRoutesV2Client`). Do not attempt to import type hints directly from `boto3` modules, as they lack full type fidelity.fixAdjust import statements to explicitly use the `mypy_boto3_SERVICE_NAME` package structure for all type annotations related to AWS services.
affects: *
gotchaAWS service names and their APIs can change or be deprecated over time (e.g., `sms-voice` service was renamed). While this package reflects the current state, always verify the service name used in `boto3.client()` and its corresponding `mypy-boto3` stub package name against the latest AWS documentation.fixRegularly check AWS documentation for service name changes or deprecations. If a service is renamed, search for the corresponding `mypy-boto3` package with the new name.
affects: *
Upgrade
Version history
1.43.21latest on PyPI · released Jun 3, 2026
Audit
Dependencies
boto3requiredProvides the runtime functionality for which these are type stubs. For accurate type checking and runtime behavior, the stub version should ideally match the installed boto3 version.