Registry /
aws / tencentcloud-sdk-python-common
Install & Compatibility
Where this runs
tested against v3.1.117 · 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 0.657s · 351.6MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 10.1s · import 0.599s · 423MB
430MB installed
● package 430MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Credential
✓ from tencentcloud.common.credential import Credential
ClientProfile
✓ from tencentcloud.common.profile.client_profile import ClientProfile
HttpProfile
✓ from tencentcloud.common.profile.http_profile import HttpProfile
AbstractModel
✓ from tencentcloud.common.abstract_model import AbstractModel
TencentCloudSDKException
✓ from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
This quickstart demonstrates how to use the common components (`Credential`, `ClientProfile`, `HttpProfile`) to initialize a service client (e.g., `CvmClient`) and make a basic API call. Ensure your `TENCENTCLOUD_SECRET_ID` and `TENCENTCLOUD_SECRET_KEY` environment variables are set.
import os
from tencentcloud.common.credential import Credential
from tencentcloud.common.profile.client_profile import ClientProfile
from tencentcloud.common.profile.http_profile import HttpProfile
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
from tencentcloud.cvm.v20170312.client import CvmClient
from tencentcloud.cvm.v20170312.models import DescribeInstancesRequest
try:
# Set credentials via environment variables for security
secret_id = os.environ.get("TENCENTCLOUD_SECRET_ID", "")
secret_key = os.environ.get("TENCENTCLOUD_SECRET_KEY", "")
region = "ap-guangzhou" # Replace with your desired region
cred = Credential(secret_id, secret_key)
http_profile = HttpProfile()
# Specify the endpoint for the service if needed, otherwise it's auto-resolved
http_profile.endpoint = "cvm.tencentcloudapi.com"
client_profile = ClientProfile()
client_profile.httpProfile = http_profile
# Initialize a service client (e.g., CVMClient) using common components
client = CvmClient(cred, region, client_profile)
# Create a request object for a specific API operation
req = DescribeInstancesRequest()
# For a basic test, no specific filters are applied, listing all instances
# Call the API and print the response
resp = client.DescribeInstances(req)
print(resp.to_json_string())
except TencentCloudSDKException as err:
print(f"An error occurred: {err}")
print(f"Error Code: {err.get_code()}")
print(f"Request ID: {err.get_request_id()}")
Debug
Known issues
gotchaThe Tencent Cloud Python SDK has undergone a major rewrite. Ensure you are using the modern `tencentcloud-sdk-python` package family (v3+), not the deprecated `qcloud_sdk_python`.fixInstall `tencentcloud-sdk-python` or service-specific packages like `tencentcloud-sdk-python-cvm`. Update import statements from `QcloudApi` or similar to `tencentcloud.common.*` and `tencentcloud.service.version.client.*`. Consult the official migration guide.
affects: All versions of `tencentcloud-sdk-python-common` (v3.x.x)
gotchaThe SDK is modular. If you only install `tencentcloud-sdk-python-common`, you will not have access to service-specific clients (e.g., `CvmClient`) for API calls.fixFor specific services, install their respective packages (e.g., `pip install tencentcloud-sdk-python-cvm`) or install the monolithic `pip install tencentcloud-sdk-python` which includes all services and common modules.
affects: All v3.x.x
gotchaCredential handling is critical. Incorrectly providing `SecretId` and `SecretKey` or omitting them is a common source of authentication failures.fixProvide credentials securely via environment variables (`TENCENTCLOUD_SECRET_ID`, `TENCENTCLOUD_SECRET_KEY`), or directly when initializing the `Credential` object. Avoid hardcoding sensitive credentials in source code.
affects: All v3.x.x
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'tencentcloud.cvm'
The service-specific package (e.g., CVM) was not installed, or only `tencentcloud-sdk-python-common` was installed without the specific service module.
fixInstall the full SDK (`pip install tencentcloud-sdk-python`) or the specific service package (`pip install tencentcloud-sdk-python-cvm`).
TencentCloudSDKException: Code=AuthFailure.SecretIdNotFound
The Tencent Cloud SecretId or SecretKey were not provided, are incorrect, or the environment variables are not loaded.
fixEnsure `TENCENTCLOUD_SECRET_ID` and `TENCENTCLOUD_SECRET_KEY` environment variables are set correctly, or pass them directly when initializing `Credential(secret_id, secret_key)`.
TypeError: 'module' object is not callable (e.g., client = CvmClient)
Attempting to use a class (like `CvmClient` or `DescribeInstancesRequest`) as if it were a function without instantiating it.
fixEnsure you instantiate classes using parentheses, e.g., `client = CvmClient(cred, region, client_profile)` and `req = DescribeInstancesRequest()`.
ModuleNotFoundError: No module named 'QcloudApi'
Attempting to use code from the legacy and deprecated `qcloud_sdk_python` package with the modern SDK.
fixMigrate your code to use the `tencentcloud-sdk-python` library. Update imports and client initialization patterns to match the current SDK documentation.
Upgrade
Version history
3.1.117latest on PyPI · released Jun 16, 2026
Audit
Dependencies
No dependency data recorded yet.