Tencent Cloud Tione SDK for Python
raw JSON → 3.1.88 verified Sat May 09 auth: no python
Official Python SDK for Tencent Cloud Tione (AI Platform), providing APIs for training, model management, and inference. Current version 3.1.88. Released on PyPI with regular updates aligned to Tencent Cloud API changes.
pip install tencentcloud-sdk-python-tione Common errors
error ModuleNotFoundError: No module named 'tencentcloud.tione.v20211111' ↓
cause Missing package or wrong import; requires tencentcloud-sdk-python-common and correct versioned subpackage.
fix
pip install tencentcloud-sdk-python-common and use 'from tencentcloud.tione.v20211111 import ...'
error TencentCloudSDKException: [TencentCloudSDKException] code: AuthFailure.SecretIdNotFound ↓
cause Invalid or missing SecretId/SecretKey in environment or credential object.
fix
Ensure TENCENTCLOUD_SECRET_ID and TENCENTCLOUD_SECRET_KEY are set correctly.
Warnings
breaking Version v20211111 is the only supported API version; older imports may fail silently. ↓
fix Always use 'from tencentcloud.tione.v20211111 import ...'
gotcha Region must be specified; validation fails if omitted or misspelled (e.g. 'ap-hongkong' vs 'ap-hongkong'). ↓
fix Check region availability in Tencent Cloud console and use lower-hyphen format.
deprecated The old 'from tencentcloud.tione.tione_client import TioneClient' path was removed in v3.1.0+. ↓
fix Use the versioned import path from tencentcloud.tione.v20211111.tione_client
Imports
- TioneClient wrong
from tencentcloud.tione import TioneClientcorrectfrom tencentcloud.tione.v20211111 import tione_client - models wrong
from tencentcloud.tione import modelscorrectfrom tencentcloud.tione.v20211111 import models
Quickstart
import os
from tencentcloud.common import credential
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
from tencentcloud.tione.v20211111 import tione_client, models
secret_id = os.environ.get('TENCENTCLOUD_SECRET_ID', '')
secret_key = os.environ.get('TENCENTCLOUD_SECRET_KEY', '')
cred = credential.Credential(secret_id, secret_key)
client = tione_client.TioneClient(cred, "ap-guangzhou")
try:
req = models.CreateNotebookRequest()
req.NotebookName = "test-notebook"
req.ChargeType = "POSTPAID_BY_HOUR"
resp = client.CreateNotebook(req)
print(resp.RequestId)
except TencentCloudSDKException as e:
print(e)