{"id":28353,"library":"tencentcloud-sdk-python-smpn","title":"Tencent Cloud SMPN SDK for Python","description":"Official Tencent Cloud SDK for the SMS Package Notification (SMPN) service. Version 3.0.1416 follows the new SDK structure under `tencentcloud.smpn` module. Released alongside the main tencentcloud-sdk-python suite, updated frequently with API changes.","status":"active","version":"3.0.1416","language":"python","source_language":"en","source_url":"https://github.com/TencentCloud/tencentcloud-sdk-python","tags":["tencent-cloud","sdk","smpn","sms","china-cloud"],"install":[{"cmd":"pip install tencentcloud-sdk-python-smpn","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core SDK dependencies: credential, HTTP transport, and request signing.","package":"tencentcloud-sdk-python-common","optional":false}],"imports":[{"note":"Client class name is lowercase with underscores: smpn_client, not CamelCase.","wrong":"from tencentcloud.smpn.v20190822 import SmpnClient","symbol":"SmpnClient","correct":"from tencentcloud.smpn.v20190822 import smpn_client"},{"note":"Request models are in the models module, not importable directly from version package.","wrong":"from tencentcloud.smpn.v20190822 import DescribeSmpnChpRequest","symbol":"DescribeSmpnChpRequest","correct":"from tencentcloud.smpn.v20190822 import models"},{"note":"Credential is in tencentcloud.common.credential, not per-service.","wrong":"from tencentcloud.smpn import credential","symbol":"Credential","correct":"from tencentcloud.common import credential"}],"quickstart":{"code":"import os\nfrom tencentcloud.common import credential\nfrom tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException\nfrom tencentcloud.smpn.v20190822 import smpn_client, models\n\ntry:\n    cred = credential.Credential(\n        os.environ.get(\"TENCENTCLOUD_SECRET_ID\", \"\"),\n        os.environ.get(\"TENCENTCLOUD_SECRET_KEY\", \"\")\n    )\n    client = smpn_client.SmpnClient(cred, \"ap-guangzhou\")\n    req = models.DescribeSmpnChpRequest()\n    req.ResourceId = \"your-resource-id\"\n    resp = client.DescribeSmpnChp(req)\n    print(resp.to_json_string())\nexcept TencentCloudSDKException as e:\n    print(e)","lang":"python","description":"Quickstart with environment variable based credentials."},"warnings":[{"fix":"Uninstall the old `tencentcloud-sdk-python` and install the per-service package: `pip uninstall tencentcloud-sdk-python; pip install tencentcloud-sdk-python-smpn`","message":"The 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.","severity":"breaking","affected_versions":"<=2.x (monolithic SDK)"},{"fix":"Use: `from tencentcloud.smpn.v20190822 import smpn_client; client = smpn_client.SmpnClient(...)`","message":"Client class name is `smpn_client.SmpnClient` (lowercase module, class starting uppercase). Many users mistakenly try `SmpnClient` from the version package and get AttributeError.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Use: `from tencentcloud.smpn.v20190822 import models` then `models.DescribeSmpnChpRequest()`","message":"Requests 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.","severity":"deprecated","affected_versions":"3.0.1000+"},{"fix":"Use: `from tencentcloud.common import credential` then `credential.Credential(...)`","message":"Credential class is not directly importable from tencentcloud.common – you need the credential submodule.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"from tencentcloud.smpn.v20190822 import smpn_client\nclient = smpn_client.SmpnClient(...)","cause":"Incorrect import path: trying to import CamelCase class directly from version package.","error":"ImportError: cannot import name 'SmpnClient' from 'tencentcloud.smpn.v20190822'"},{"fix":"Install the per-service package: `pip install --upgrade tencentcloud-sdk-python-smpn`","cause":"The per-service package may be outdated or missing; the monolithic SDK structure doesn't have a models submodule.","error":"AttributeError: module 'tencentcloud.smpn.v20190822' has no attribute 'models'"},{"fix":"Check the region (e.g., 'ap-guangzhou') and ensure the SecretId/SecretKey have SMPN service access.","cause":"Using wrong endpoint or the action is not supported in the specified region, or credential lacks required permissions.","error":"TencentCloudSDKException: [TencentCloudSDKException] code: UnsupportedOperation, message: this action does not support any CAM, service: smpn"},{"fix":"Install common package: `pip install tencentcloud-sdk-python-common` or reinstall the per-service package which should pull it as dependency.","cause":"The common SDK is missing; per-service package depends on tencentcloud-sdk-python-common.","error":"ModuleNotFoundError: No module named 'tencentcloud'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}