Registry /
aws / tencentcloud-sdk-python-smpn
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
SmpnClient
✓ from tencentcloud.smpn.v20190822 import smpn_client
✗ from tencentcloud.smpn.v20190822 import SmpnClient
Client class name is lowercase with underscores: smpn_client, not CamelCase.
DescribeSmpnChpRequest
✓ from tencentcloud.smpn.v20190822 import models
✗ from tencentcloud.smpn.v20190822 import DescribeSmpnChpRequest
Request models are in the models module, not importable directly from version package.
Credential
✓ from tencentcloud.common import credential
✗ from tencentcloud.smpn import credential
Credential is in tencentcloud.common.credential, not per-service.
Quickstart with environment variable based credentials.
import os
from tencentcloud.common import credential
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
from tencentcloud.smpn.v20190822 import smpn_client, models
try:
cred = credential.Credential(
os.environ.get("TENCENTCLOUD_SECRET_ID", ""),
os.environ.get("TENCENTCLOUD_SECRET_KEY", "")
)
client = smpn_client.SmpnClient(cred, "ap-guangzhou")
req = models.DescribeSmpnChpRequest()
req.ResourceId = "your-resource-id"
resp = client.DescribeSmpnChp(req)
print(resp.to_json_string())
except TencentCloudSDKException as e:
print(e)
Debug
Known issues
breakingThe SDK moved from `tencentcloud-sdk-python` (monolithic) to per-service packages. Import paths changed from `tencentcloud.smpn.v20190822.smpn_client` to module-level access. Code using the old monolithic SDK must reinstall per-service packages and update imports.fixUninstall the old `tencentcloud-sdk-python` and install the per-service package: `pip uninstall tencentcloud-sdk-python; pip install tencentcloud-sdk-python-smpn`
affects: <=2.x (monolithic SDK)
gotchaClient class name is `smpn_client.SmpnClient` (lowercase module, class starting uppercase). Many users mistakenly try `SmpnClient` from the version package and get AttributeError.fixUse: `from tencentcloud.smpn.v20190822 import smpn_client; client = smpn_client.SmpnClient(...)`
affects: >=3.0.0
deprecatedRequests models are not directly importable from the version package, but earlier examples encouraged `from ... import DescribeSmpnChpRequest`. This pattern no longer works; models must be imported from the `models` submodule.fixUse: `from tencentcloud.smpn.v20190822 import models` then `models.DescribeSmpnChpRequest()`
affects: 3.0.1000+
gotchaCredential class is not directly importable from tencentcloud.common – you need the credential submodule.fixUse: `from tencentcloud.common import credential` then `credential.Credential(...)`
affects: all
Errors
Common errors & fixes
ImportError: cannot import name 'SmpnClient' from 'tencentcloud.smpn.v20190822'
Incorrect import path: trying to import CamelCase class directly from version package.
fixfrom tencentcloud.smpn.v20190822 import smpn_client
client = smpn_client.SmpnClient(...)
AttributeError: module 'tencentcloud.smpn.v20190822' has no attribute 'models'
The per-service package may be outdated or missing; the monolithic SDK structure doesn't have a models submodule.
fixInstall the per-service package: `pip install --upgrade tencentcloud-sdk-python-smpn`
TencentCloudSDKException: [TencentCloudSDKException] code: UnsupportedOperation, message: this action does not support any CAM, service: smpn
Using wrong endpoint or the action is not supported in the specified region, or credential lacks required permissions.
fixCheck the region (e.g., 'ap-guangzhou') and ensure the SecretId/SecretKey have SMPN service access.
ModuleNotFoundError: No module named 'tencentcloud'
The common SDK is missing; per-service package depends on tencentcloud-sdk-python-common.
fixInstall common package: `pip install tencentcloud-sdk-python-common` or reinstall the per-service package which should pull it as dependency.
Upgrade
Version history
3.0.1416latest on PyPI · released Jul 5, 2025
Audit
Dependencies
tencentcloud-sdk-python-commonrequiredCore SDK dependencies: credential, HTTP transport, and request signing.