{"id":28362,"library":"tencentcloud-sdk-python-tcb","title":"Tencent Cloud SDK for Python - TCB","description":"The official Tencent Cloud Python SDK for the Tencent Cloud Base (TCB) service. Version 3.1.92 provides APIs for managing cloud functions, databases, storage, and static hosting. Released frequently in sync with the main tencentcloud-sdk-python package.","status":"active","version":"3.1.92","language":"python","source_language":"en","source_url":"https://github.com/TencentCloud/tencentcloud-sdk-python","tags":["tencentcloud","tcb","cloudbase","serverless","sdk"],"install":[{"cmd":"pip install tencentcloud-sdk-python-tcb","lang":"bash","label":"Install TCB SDK"}],"dependencies":[{"reason":"Required for common classes like Credential and client exceptions","package":"tencentcloud-sdk-python-common","optional":false}],"imports":[{"note":"Must specify version (v20180608) and import the client class from the module directly.","wrong":"from tencentcloud.tcb import TcbClient","symbol":"TcbClient","correct":"from tencentcloud.tcb.v20180608 import tcb_client"},{"note":"Models must be imported from the versioned subpackage.","wrong":"import tencentcloud.tcb.models","symbol":"models","correct":"from tencentcloud.tcb.v20180608 import models"}],"quickstart":{"code":"import os\nfrom tencentcloud.common import credential\nfrom tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException\nfrom tencentcloud.tcb.v20180608 import tcb_client, models\n\ntry:\n    cred = credential.Credential(secret_id=os.environ.get('TENCENTCLOUD_SECRET_ID'), secret_key=os.environ.get('TENCENTCLOUD_SECRET_KEY'))\n    client = tcb_client.TcbClient(cred, 'ap-guangzhou')\n    req = models.DescribeEnvsRequest()\n    resp = client.DescribeEnvs(req)\n    print(resp)\nexcept TencentCloudSDKException as e:\n    print(e)","lang":"python","description":"Initialize TCB client and describe environments."},"warnings":[{"fix":"Always import from tencentcloud.tcb.v20180608.","message":"The TCB SDK uses a versioned API endpoint (v20180608). Do not import directly from tencentcloud.tcb without the version subpackage.","severity":"gotcha","affected_versions":"all"},{"fix":"Update import paths to include version subpackage (v20180608) and use new client classes.","message":"Older versions (pre-3.0) had different import paths and client initialization. Upgrading from 2.x to 3.x requires changing all imports.","severity":"breaking","affected_versions":"<3.0"},{"fix":"Run pip install tencentcloud-sdk-python-tcb.","message":"The TCB SDK is a separate package. Installing tencentcloud-sdk-python alone does not include TCB; you must install tencentcloud-sdk-python-tcb explicitly.","severity":"gotcha","affected_versions":"all"},{"fix":"Use the 'region' parameter when creating TcbClient.","message":"Endpoint configuration via environment variable TENCENTCLOUD_ENDPOINT may be deprecated in future versions. Always set the region in the client constructor.","severity":"deprecated","affected_versions":"3.x"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Install both: pip install tencentcloud-sdk-python-common tencentcloud-sdk-python-tcb","cause":"Missing common package or TCB SDK not installed.","error":"ModuleNotFoundError: No module named 'tencentcloud'"},{"fix":"Use: from tencentcloud.tcb.v20180608 import tcb_client","cause":"Importing directly from tencentcloud.tcb instead of the versioned subpackage.","error":"AttributeError: module 'tencentcloud.tcb' has no attribute 'TcbClient'"},{"fix":"Check supported regions and provide a valid region like 'ap-guangzhou'.","cause":"The region provided is not valid or not supported by TCB service.","error":"tencentcloud.common.exception.TencentCloudSDKException: [TencentCloudSDKException] code: UnsupportedRegion"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}