Tencent Cloud Youmall SDK for Python
raw JSON → 3.0.1416 verified Sat May 09 auth: no python maintenance
The Tencent Cloud Youmall SDK enables developers to manage and interact with Tencent Cloud's Youmall (Tencent Youmall) services. Version 3.0.1416 is part of the v3 SDK which offers consistent client interfaces, but it has no active releases since 2021 and should be considered maintenance-only. The preferred way to use Tencent Cloud services is via the unified tencentcloud-sdk-python with the corresponding product module.
pip install tencentcloud-sdk-python-youmall Common errors
error ModuleNotFoundError: No module named 'tencentcloud.youmall' ↓
cause The SDK package is not installed or the import path is incorrect.
fix
Install the package: pip install tencentcloud-sdk-python-youmall. Also ensure you have the common module: pip install tencentcloud-sdk-python-common. Import from the versioned path: from tencentcloud.youmall.v20180228 import youmall_client
error tencentcloud.common.exception.tencent_cloud_sdk_exception.TencentCloudSDKException: [TencentCloudSDKException] code:AuthFailure.SecretIdNotFound - The SecretId is not found, please check your SecretId ↓
cause The provided SecretId/SecretKey are invalid or not set as environment variables.
fix
Verify your TencentCloud API credentials and set TENCENTCLOUD_SECRET_ID and TENCENTCLOUD_SECRET_KEY environment variables. Alternatively, pass them directly to the Credential constructor.
error tencentcloud.common.exception.tencent_cloud_sdk_exception.TencentCloudSDKException: code:UnsupportedRegion - the region is not supported ↓
cause The region passed to the client constructor is not supported by Youmall service.
fix
Use a valid region such as 'ap-guangzhou' or 'ap-shenzhen-fsi'. Check the Tencent Cloud region documentation for supported regions.
error AttributeError: module 'tencentcloud.youmall.v20180228' has no attribute 'models' ↓
cause The models module is not imported correctly; likely the import path is missing the 'v20180228' part.
fix
Use: from tencentcloud.youmall.v20180228 import models
Warnings
deprecated This SDK is no longer actively maintained. No new features or API updates have been released since 2021. Consider migrating to the unified tencentcloud-sdk-python (if a Youmall module exists) or using the HTTP API directly. ↓
fix Check the Tencent Cloud documentation for the latest service availability and use the recommended SDK.
breaking The v3 SDK changed import paths to include the API version (e.g., v20180228). Older code using flat imports will break. ↓
fix Update imports to include the versioned path, e.g., from tencentcloud.youmall.v20180228 import youmall_client
gotcha The SDK requires an active Tencent Cloud account and the Youmall service to be enabled. Without proper service activation, API calls will fail with auth or not-enabled errors. ↓
fix Ensure Youmall service is enabled in the Tencent Cloud console and that your API keys have the necessary permissions.
Install
pip install tencentcloud-sdk-python-common tencentcloud-sdk-python-youmall Imports
- youmall_client wrong
from tencentcloud.youmall import clientcorrectfrom tencentcloud.youmall.v20180228 import youmall_client - models wrong
from tencentcloud.youmall import modelscorrectfrom tencentcloud.youmall.v20180228 import models
Quickstart
import os
from tencentcloud.common import credential
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
from tencentcloud.youmall.v20180228 import youmall_client, models
try:
cred = credential.Credential(
os.environ.get('TENCENTCLOUD_SECRET_ID', ''),
os.environ.get('TENCENTCLOUD_SECRET_KEY', '')
)
client = youmall_client.YoumallClient(cred, 'ap-guangzhou')
req = models.DescribePersonInfoRequest()
req.CompanyId = 'your_company_id'
resp = client.DescribePersonInfo(req)
print(resp.to_json_string())
except TencentCloudSDKException as err:
print(err)