{"id":28361,"library":"tencentcloud-sdk-python-tbaas","title":"Tencent Cloud Tbaas SDK for Python","description":"Official Tencent Cloud SDK for Python, specifically for the TBaaS (Tencent Blockchain as a Service) product. Current version is 3.0.1459. Released irregularly alongside other Tencent Cloud SDK packages.","status":"active","version":"3.0.1459","language":"python","source_language":"en","source_url":"https://github.com/TencentCloud/tencentcloud-sdk-python","tags":["tencent-cloud","tbaas","blockchain","sdk"],"install":[{"cmd":"pip install tencentcloud-sdk-python-tbaas","lang":"bash","label":"Install from PyPI"},{"cmd":"pip install tencentcloud-sdk-python-common","lang":"bash","label":"Required common library"}],"dependencies":[{"reason":"Required for all API calls (client, credentials, exceptions)","package":"tencentcloud-sdk-python-common","optional":false},{"reason":"Underlying HTTP library for API requests","package":"requests","optional":false}],"imports":[{"note":"Correct package path includes versioned API module","wrong":"from tbaas import TbaasClient","symbol":"TbaasClient","correct":"from tencentcloud.tbaas.v20180416 import tbaas_client"}],"quickstart":{"code":"import os\nfrom tencentcloud.common import credential\nfrom tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException\nfrom tencentcloud.tbaas.v20180416 import tbaas_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 = tbaas_client.TbaasClient(cred, \"ap-guangzhou\")\n    req = models.DescribeFabricBlockRequest()\n    req.BlockNumber = 0\n    req.ChannelId = \"mychannel\"\n    resp = client.DescribeFabricBlock(req)\n    print(resp.to_json_string())\nexcept TencentCloudSDKException as err:\n    print(err)","lang":"python","description":"Initialize client with credentials and call a TBaaS API."},"warnings":[{"fix":"Update imports: `from tencentcloud.tbaas.v20180416 import models` and use `models.DescribeFabricBlockRequest()`.","message":"The old SDK (v2.x) used a different import structure (e.g., `from tencentcloud.tbaas.v20180416 import tbaas_client` vs `from tencentcloud.tbaas.v20180416.models import ...`). In v3, model classes must be imported from `models` submodule.","severity":"breaking","affected_versions":"<3.0.0"},{"fix":"Check available regions for TBaaS in Tencent Cloud documentation and specify a valid region when creating the client.","message":"All API operations require a correct region parameter. TBaaS supports limited regions (e.g., ap-guangzhou, ap-beijing). Using an unsupported region will cause a 'RegionUnavailable' error.","severity":"gotcha","affected_versions":"all"},{"fix":"Verify the exact channel ID and block number from your TBaaS console or network config.","message":"The `ChannelId` and `BlockNumber` parameters must exactly match the blockchain network configuration. For example, channel names are case-sensitive.","severity":"gotcha","affected_versions":"all"},{"fix":"Check the latest API documentation and migrate to supported actions like `DescribeFabricBlock` or `InvokeFabricContract`.","message":"Some older TBaaS API actions (like `InvokeChainMakerContract`) are deprecated in favor of newer Fabric-specific methods. Using deprecated endpoints may stop working without notice.","severity":"deprecated","affected_versions":">=3.0.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Ensure TENCENTCLOUD_SECRET_ID and TENCENTCLOUD_SECRET_KEY environment variables are set correctly, and that the account has been granted TBaaS access via CAM.","cause":"Missing or invalid SecretId/SecretKey, or the account does not have permission for TBaaS operations.","error":"tencentcloud.common.exception.tencent_cloud_sdk_exception.TencentCloudSDKException: [TencentCloudSDKException] code: UnauthorizedOperation, message: You are not authorized to perform this action"},{"fix":"Run: pip install tencentcloud-sdk-python-common","cause":"Missing required common package.","error":"ModuleNotFoundError: No module named 'tencentcloud'"},{"fix":"Verify the exact channel ID from the TBaaS console. Note that channel names are case-sensitive.","cause":"The channel name does not exist or is misspelled.","error":"tencentcloud.common.exception.tencent_cloud_sdk_exception.TencentCloudSDKException: code: InvalidParameter, message: Parameter [ChannelId] is invalid"},{"fix":"Use correct import: `from tencentcloud.tbaas.v20180416 import tbaas_client`","cause":"Attempted to import from wrong path (e.g., using `from tencentcloud.tbaas import tbaas_client`).","error":"AttributeError: module 'tencentcloud.tbaas.v20180416' has no attribute 'tbaas_client'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}