Registry /
aws / tencentcloud-sdk-python-tcb
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.
TcbClient
✓ from tencentcloud.tcb.v20180608 import tcb_client
✗ from tencentcloud.tcb import TcbClient
Must specify version (v20180608) and import the client class from the module directly.
models
✓ from tencentcloud.tcb.v20180608 import models
✗ import tencentcloud.tcb.models
Models must be imported from the versioned subpackage.
Initialize TCB client and describe environments.
import os
from tencentcloud.common import credential
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
from tencentcloud.tcb.v20180608 import tcb_client, models
try:
cred = credential.Credential(secret_id=os.environ.get('TENCENTCLOUD_SECRET_ID'), secret_key=os.environ.get('TENCENTCLOUD_SECRET_KEY'))
client = tcb_client.TcbClient(cred, 'ap-guangzhou')
req = models.DescribeEnvsRequest()
resp = client.DescribeEnvs(req)
print(resp)
except TencentCloudSDKException as e:
print(e)
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'tencentcloud'
Missing common package or TCB SDK not installed.
fixInstall both: pip install tencentcloud-sdk-python-common tencentcloud-sdk-python-tcb
AttributeError: module 'tencentcloud.tcb' has no attribute 'TcbClient'
Importing directly from tencentcloud.tcb instead of the versioned subpackage.
fixUse: from tencentcloud.tcb.v20180608 import tcb_client
tencentcloud.common.exception.TencentCloudSDKException: [TencentCloudSDKException] code: UnsupportedRegion
The region provided is not valid or not supported by TCB service.
fixCheck supported regions and provide a valid region like 'ap-guangzhou'.
Upgrade
Version history
3.1.92latest on PyPI · released May 7, 2026
Audit
Dependencies
tencentcloud-sdk-python-commonrequiredRequired for common classes like Credential and client exceptions