Registry /
aws / alibabacloud-ims20190815
Install & Compatibility
Where this runs
tested against v3.3.7 · 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.920 runs
installs and imports cleanly · install 0.0s · import 1.544s · 52.3MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 8.3s · import 1.423s · 54MB
52MB installed
● package 52MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Client
✓ from alibabacloud_ims20190815.client import Client
models
✓ from alibabacloud_ims20190815 import models
✗ from alibabacloud_ims20190815.models import ListAccessKeysRequest
While importing specific models directly is correct, importing `models` module and accessing attributes from it is more common and avoids long import lines for multiple request/response types.
Config
✓ from alibabacloud_tea_openapi.models import Config
The `Config` class for client configuration is provided by the shared `alibabacloud-tea-openapi` dependency, not directly by the service SDK.
This quickstart demonstrates how to initialize the IMS client using environment variables for authentication and make a basic API call to list access keys. It highlights the use of `Config` from `alibabacloud_tea_openapi` and the `Client` and `models` from the specific IMS SDK.
import os
from alibabacloud_ims20190815.client import Client as ImsClient
from alibabacloud_ims20190815 import models as ImsModels
from alibabacloud_tea_openapi.models import Config
# Ensure environment variables are set for authentication
# export ALIBABA_CLOUD_ACCESS_KEY_ID='your_access_key_id'
# export ALIBABA_CLOUD_ACCESS_KEY_SECRET='your_access_key_secret'
# Configure client with Access Key, Secret, and Region
# Default region 'cn-hangzhou' might work, but specify if needed.
config = Config(
access_key_id=os.environ.get('ALIBABA_CLOUD_ACCESS_KEY_ID', ''),
access_key_secret=os.environ.get('ALIBABA_CLOUD_ACCESS_KEY_SECRET', ''),
region_id='cn-hangzhou' # Or your desired region, e.g., 'ap-southeast-1'
)
# If a specific endpoint is required (e.g., private link, specific region), uncomment and set it.
# config.endpoint = 'ims.cn-hangzhou.aliyuncs.com'
try:
# Initialize the client
client = ImsClient(config)
# Create a request object (e.g., for listing access keys)
list_access_keys_request = ImsModels.ListAccessKeysRequest()
# Call the API
response = client.list_access_keys(list_access_keys_request)
# Print the response body
print(response.body)
except Exception as e:
print(f"An error occurred: {e}")
Errors
Common errors & fixes
TypeError: __init__() missing 1 required positional argument: 'config'
The client class (e.g., `ImsClient`) requires a `Config` object during initialization.
fixPass a valid `Config` instance when creating the client: `client = ImsClient(config)`.
NoCredentialProviderError: The AK/SK credentials must be set correctly.
The SDK could not find valid Alibaba Cloud Access Key ID and Secret. This usually means environment variables are not set or the `Config` object was not correctly initialized with credentials.
fixSet `ALIBABA_CLOUD_ACCESS_KEY_ID` and `ALIBABA_CLOUD_ACCESS_KEY_SECRET` environment variables, or pass `access_key_id` and `access_key_secret` directly to the `Config` constructor.
SDK.ServerError: {"Code":"InvalidAccessKeyId.NotFound","Message":"The Access Key ID provided does not exist in our records.",...}
The provided Access Key ID is incorrect, revoked, or does not belong to your Alibaba Cloud account.
fixVerify that `ALIBABA_CLOUD_ACCESS_KEY_ID` is correct. Check the Alibaba Cloud console for the status of the Access Key and ensure it matches what is being used.
SDK.ServerError: {"Code":"SignatureDoesNotMatch","Message":"The request signature does not conform to Alibaba Cloud standards.",...}
The Access Key Secret used to sign the request is incorrect.
fixVerify that `ALIBABA_CLOUD_ACCESS_KEY_SECRET` is correct. Ensure there are no leading/trailing spaces or incorrect characters.
Upgrade
Version history
3.3.7latest on PyPI · released May 25, 2026
Audit
Dependencies
alibabacloud-tea-openapirequiredProvides the core client configuration model (Config) and utilities for Alibaba Cloud SDKs.
alibabacloud-tea-utilrequiredProvides common utility functions used by Alibaba Cloud SDKs.