Registry /
aws / tencentcloud-sdk-python-waf
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.
WafClient
✓ from tencentcloud.waf.v20180125 import waf_client, models
✗ from tencentcloud.waf import WafClient
Versioned import (v20180125) is required; top-level import fails.
Initialize WAF client and call DescribeWafInfo. Replace region as needed.
import os
from tencentcloud.common import credential
from tencentcloud.waf.v20180125 import waf_client, models
cred = credential.Credential(
os.environ.get('TENCENTCLOUD_SECRET_ID', ''),
os.environ.get('TENCENTCLOUD_SECRET_KEY', '')
)
client = waf_client.WafClient(cred, "ap-guangzhou")
req = models.DescribeWafInfoRequest()
resp = client.DescribeWafInfo(req)
print(resp.to_json_string())
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'tencentcloud.waf'
The per-service package tencentcloud-sdk-python-waf was not installed, or common module is missing.
fixInstall both: pip install tencentcloud-sdk-python-waf tencentcloud-sdk-python-common
AttributeError: module 'tencentcloud.waf' has no attribute 'WafClient'
Direct import from tencentcloud.waf does not expose WafClient; versioned subpackage is required.
fixUse from tencentcloud.waf.v20180125 import waf_client
tencentcloud.common.exception.TencentCloudSDKException: UnsupportedRegion
Region string is invalid or not supported by WAF service.
fixUse a valid region like 'ap-guangzhou', 'ap-shanghai', etc. Check Tencent Cloud docs.
Upgrade
Version history
3.1.91latest on PyPI · released May 6, 2026
Audit
Dependencies
tencentcloud-sdk-python-commonrequiredRequired for authentication and HTTP transport