types-aiobotocore-servicediscovery
raw JSON → 3.5.0 verified Fri May 01 auth: no python
Type annotations for aiobotocore ServiceDiscovery 3.5.0 service generated with mypy-boto3-builder 8.12.0. Provides static type checking support for AWS Cloud Map (ServiceDiscovery) client operations, paginators, and waiters. Requires Python 3.9+ and is released alongside aiobotocore stubs.
pip install types-aiobotocore-servicediscovery Common errors
error ModuleNotFoundError: No module named 'types_aiobotocore_servicediscovery' ↓
cause The package is installed but not meant to be imported directly; it does not export a top-level module named 'types_aiobotocore_servicediscovery'.
fix
Do not import from this package directly. Install the package and use normal aiobotocore imports (e.g., from aiobotocore.client import ServiceDiscoveryClient).
error AttributeError: module 'aiobotocore.client' has no attribute 'ServiceDiscoveryClient' ↓
cause Invalid import path; ServiceDiscoveryClient is not a direct attribute of aiobotocore.client.
fix
Use get_session().create_client('servicediscovery') or import from aiobotocore.client if it exists (but typically you create client via session). For type annotations, the stubs provide the type, not the actual runtime class.
error Cannot find reference 'ServiceDiscoveryClient' in '__init__.pyi' ↓
cause IDE or type checker is looking for the type in types-aiobotocore-servicediscovery, but the type is defined in aiobotocore stubs.
fix
Ensure the aiobotocore package with stubs (e.g., types-aiobotocore) is installed: pip install types-aiobotocore
error mypy: Name 'ServiceDiscoveryClient' is not defined ↓
cause Missing type stubs for aiobotocore or incorrect import.
fix
Install types-aiobotocore-servicediscovery and types-aiobotocore, and import from aiobotocore.client (if using explicit type annotations) or use get_session().
Warnings
gotcha This package provides type annotations only; you still need to install aiobotocore and botocore at runtime. ↓
fix Install aiobotocore: pip install aiobotocore
breaking Version 8.12.0 removed Python 3.8 support (requires >=3.9). ↓
fix Upgrade to Python 3.9 or later.
deprecated TypeDefs with 'Request' suffix were shortened (breaking change in generator 8.9.0). For example, ListNamespacesRequestRequestTypeDef became ListNamespacesRequestTypeDef. ↓
fix Check the updated type names in your stubs; use shorter names like ListNamespacesRequestTypeDef.
gotcha The stubs are generated for a specific aiobotocore version (3.5.0). Mismatched versions may cause type errors. ↓
fix Ensure types-aiobotocore-servicediscovery version matches aiobotocore major.minor version.
Imports
- ServiceDiscoveryClient
from aiobotocore.client import ServiceDiscoveryClient - ServiceDiscoveryPaginator wrong
from types_aiobotocore_servicediscovery import ServiceDiscoveryPaginatorcorrectfrom aiobotocore.paginate import ServiceDiscoveryPaginator - ServiceDiscoveryWaiter wrong
from types_aiobotocore_servicediscovery import ServiceDiscoveryWaitercorrectfrom aiobotocore.waiter import ServiceDiscoveryWaiter
Quickstart
import asyncio
from aiobotocore.session import get_session
async def main():
session = get_session()
async with session.create_client('servicediscovery', region_name='us-east-1') as client:
# Example: list namespaces
response = await client.list_namespaces()
print(response)
if __name__ == '__main__':
asyncio.run(main())