Tencent Cloud HCM SDK for Python
raw JSON → 3.1.78 verified Sat May 09 auth: no python
Tencent Cloud HCM (Human Cloud Matching) SDK for Python. Provides APIs for face recognition, human cloud matching, and related AI services. Current version 3.1.78. Release cadence follows the main tencentcloud-sdk-python monthly releases.
pip install tencentcloud-sdk-python-hcm Common errors
error ImportError: cannot import name 'HcmClient' from 'tencentcloud.hcm.v20181106' ↓
cause Forgot to import from the correct submodule hcm_client, or used wrong API version.
fix
Use: from tencentcloud.hcm.v20181106 import hcm_client
error ModuleNotFoundError: No module named 'tencentcloud.common' ↓
cause Missing the common dependency package.
fix
Install the common package: pip install tencentcloud-sdk-python-common
Warnings
deprecated Older SDK versions (before 3.x) used a different import pattern under 'tencentcloud-sdk-python' package directly. Ensure you use the per-service package. ↓
fix Install tencentcloud-sdk-python-hcm instead of the monolithic tencentcloud-sdk-python.
gotcha The API version (v20181106) is part of the import path. Using the wrong version leads to ImportError. ↓
fix Always use v20181106 for HCM. If unsure, check the module list: pip show tencentcloud-sdk-python-hcm
gotcha Some users forget to import models, causing AttributeError when constructing requests. ↓
fix Always import models: from tencentcloud.hcm.v20181106 import models
Imports
- HcmClient
from tencentcloud.hcm.v20181106 import hcm_client
Quickstart
import os
from tencentcloud.common import credential
from tencentcloud.hcm.v20181106 import hcm_client, models
creds = credential.Credential(
os.environ.get('TENCENTCLOUD_SECRET_ID', ''),
os.environ.get('TENCENTCLOUD_SECRET_KEY', '')
)
client = hcm_client.HcmClient(creds, 'ap-guangzhou')
req = models.DescribeImageRequest()
# set request parameters...
response = client.DescribeImage(req)
print(response)