{"id":28373,"library":"tencentcloud-sdk-python-vm","title":"Tencent Cloud VM SDK for Python","description":"The Tencent Cloud VM (Video Moderation) SDK for Python enables integration with Tencent Cloud's content moderation services for video content. Current version 3.1.67. Release cadence is irregular, typically following Tencent Cloud API updates.","status":"active","version":"3.1.67","language":"python","source_language":"en","source_url":"https://github.com/TencentCloud/tencentcloud-sdk-python","tags":["tencentcloud","video moderation","sdk","content moderation"],"install":[{"cmd":"pip install tencentcloud-sdk-python-vm","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Required for credential handling and API client base","package":"tencentcloud-sdk-python-common","optional":false}],"imports":[{"note":"Older imports used incorrect module paths; must use exact versioned path.","wrong":"from tencentcloud.cloud.vm import VmClient","symbol":"VmClient","correct":"from tencentcloud.vm.v20201229 import vm_client"},{"note":"Models are imported separately; not all versions have the same models.","symbol":"CreateVideoModerationTask","correct":"from tencentcloud.vm.v20201229 import models"}],"quickstart":{"code":"from tencentcloud.common import credential\nfrom tencentcloud.vm.v20201229 import vm_client, models\n\ndef moderate_video():\n    cred = credential.Credential(\n        secret_id=os.environ.get('TENCENTCLOUD_SECRET_ID', ''),\n        secret_key=os.environ.get('TENCENTCLOUD_SECRET_KEY', '')\n    )\n    client = vm_client.VmClient(cred, 'ap-guangzhou')\n    req = models.CreateVideoModerationTaskRequest()\n    req.Operator = 'user'\n    req.BizType = ''\n    req.Type = 'VIDEO'\n    req.Tasks = [{'DataId': '123', 'Input': {'Url': 'https://example.com/video.mp4'}}]\n    resp = client.CreateVideoModerationTask(req)\n    return resp\n","lang":"python","description":"Initialize a VM client and create a video moderation task."},"warnings":[{"fix":"Update imports to include the API version in the path.","message":"Version 3.x uses new import paths (e.g., tencentcloud.vm.v20201229) instead of old 'tencentcloud.vm'.","severity":"breaking","affected_versions":"2.x -> 3.x"},{"fix":"Always pass a region string (e.g., 'ap-guangzhou') to VmClient.","message":"Region must be set explicitly in client initialization; no default region.","severity":"gotcha","affected_versions":"all"},{"fix":"Install the common package: pip install tencentcloud-sdk-python-common","message":"The SDK requires the 'tencentcloud-sdk-python-common' package; missing it causes ImportError.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Use versioned import: from tencentcloud.vm.v20201229 import vm_client","cause":"Old import path used after version 3.x update.","error":"ModuleNotFoundError: No module named 'tencentcloud.vm'"},{"fix":"Pass a valid region (e.g., 'ap-guangzhou') to VmClient.","cause":"Region not set or invalid region.","error":"tencentcloud.common.exception.TencentCloudSDKException: [TencentCloudSDKException] code: UnsupportedRegion error: no available region"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}