{"id":6468,"library":"tencentcloud-sdk-python","title":"Tencent Cloud SDK for Python","description":"Tencent Cloud SDK for Python is the official software development kit for interacting with Tencent Cloud services. It provides a unified, Pythonic interface to TencentCloud API 3.0, enabling developers to easily integrate various cloud products like CVM, VPC, and CBS into their applications. The SDK supports Python 3.6 and above, offering consistent API usage, error codes, and response formats across different services. It is actively maintained with frequent updates to support new services and features.","status":"active","version":"3.1.78","language":"python","source_language":"en","source_url":"https://github.com/TencentCloud/tencentcloud-sdk-python","tags":["cloud","tencent cloud","sdk","api client"],"install":[{"cmd":"pip install tencentcloud-sdk-python","lang":"bash","label":"Standard Installation"},{"cmd":"pip install --upgrade tencentcloud-sdk-python-common tencentcloud-sdk-python-cvm","lang":"bash","label":"Install specific product SDKs (e.g., CVM)"},{"cmd":"pip install -i https://mirrors.tencent.com/pypi/simple/ --upgrade tencentcloud-sdk-python","lang":"bash","label":"Chinese mainland mirror source"}],"dependencies":[],"imports":[{"symbol":"Credential","correct":"from tencentcloud.common import credential"},{"symbol":"TencentCloudSDKException","correct":"from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException"},{"note":"Product-specific imports will vary by service and API version (e.g., `cvm.v20170312`).","symbol":"CvmClient, models","correct":"from tencentcloud.cvm.v20170312 import cvm_client, models"}],"quickstart":{"code":"import os\nfrom tencentcloud.common import credential\nfrom tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException\nfrom tencentcloud.cvm.v20170312 import cvm_client, models\n\ntry:\n    # Get credentials from environment variables (recommended for security)\n    secret_id = os.environ.get('TENCENTCLOUD_SECRET_ID', 'YOUR_SECRET_ID')\n    secret_key = os.environ.get('TENCENTCLOUD_SECRET_KEY', 'YOUR_SECRET_KEY')\n\n    # Check if credentials are placeholders\n    if secret_id == 'YOUR_SECRET_ID' or secret_key == 'YOUR_SECRET_KEY':\n        print(\"Please set TENCENTCLOUD_SECRET_ID and TENCENTCLOUD_SECRET_KEY environment variables.\")\n        exit(1)\n\n    cred = credential.Credential(secret_id, secret_key)\n\n    # Instantiate the client object for a specific product (e.g., CVM)\n    # The second parameter is the region, e.g., 'ap-shanghai' or 'ap-guangzhou'\n    client = cvm_client.CvmClient(cred, \"ap-shanghai\")\n\n    # Instantiate a request object for the API (e.g., DescribeInstancesRequest)\n    req = models.DescribeInstancesRequest()\n\n    # Call the API method through the client object\n    resp = client.DescribeInstances(req)\n\n    # Print the returned response in JSON format\n    print(resp.to_json_string())\n\nexcept TencentCloudSDKException as err:\n    print(f\"An error occurred: {err}\")\nexcept Exception as e:\n    print(f\"An unexpected error occurred: {e}\")","lang":"python","description":"This quickstart demonstrates how to initialize the client with credentials, create a request object for the CVM `DescribeInstances` API, and execute the call. Ensure `TENCENTCLOUD_SECRET_ID` and `TENCENTCLOUD_SECRET_KEY` environment variables are set for authentication."},"warnings":[{"fix":"Run the `Install Certificates.command` script found within your Python installation directory on macOS.","message":"On macOS, Python 3.6+ users may encounter SSL certificate verification errors. This is due to Python no longer using system certificates. You typically need to run `/Applications/Python 3.6/Install Certificates.command` (adjust path for your Python version) to install `certifi`'s certificates.","severity":"gotcha","affected_versions":"Python 3.6+"},{"fix":"Choose either the full SDK or specific product SDKs for installation, but not both simultaneously in one environment.","message":"Do not mix the full SDK package (`tencentcloud-sdk-python`) with individual product packages (e.g., `tencentcloud-sdk-python-cvm`) in the same environment. This can lead to conflicts and unexpected behavior.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Set the `https_proxy` environment variable (e.g., `export https_proxy=\"http://your_proxy_ip:port\"`).","message":"If operating behind a proxy, you must explicitly set the `https_proxy` system environment variable, otherwise, connection timeout exceptions may occur.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Explicitly set the language parameter in your client profile or request if you require a different language for responses.","message":"The default language of the SDK has been changed to `en-US` in recent versions. If your application relies on localized responses, this change might affect the output of SDK calls.","severity":"breaking","affected_versions":"v3.0.x onwards (after specific update, exact version not specified but noted as 'latest')"}],"env_vars":null,"search_vec":"'3.0':32 '3.6':53 'across':65 'activ':70 'api':31,58,85 'applic':48 'cbs':45 'client':86 'cloud':2,7,21,39,81,83 'code':61 'consist':57 'cvm':42 'develop':15,34 'differ':66 'easili':36 'enabl':33 'error':60 'featur':80 'format':64 'frequent':73 'integr':37 'interact':18 'interfac':28 'kit':16 'like':41 'maintain':71 'new':77 'offer':56 'offici':13 'product':40 'provid':24 'python':5,10,27,52 'respons':63 'sdk':3,8,50,84 'servic':22,67,78 'softwar':14 'support':51,76 'tencent':1,6,20,82 'tencentcloud':30 'unifi':26 'updat':74 'usag':59 'various':38 'vpc':43","created_at":"2026-04-15T05:38:37.503865+00:00","updated_at":"2026-04-16T22:45:31.093584+00:00","problems":[{"fix":"pip install tencentcloud-sdk-python","cause":"The 'tencentcloud-sdk-python' library or its core components have not been installed in the current Python environment.","error":"ModuleNotFoundError: No module named 'tencentcloud'"},{"fix":"Review your SecretId and SecretKey for accuracy, ensure the region specified in the client initialization matches your API key's region, and verify your system time synchronization.","cause":"The SecretId, SecretKey, or region provided are incorrect, or your system's clock is out of sync, leading to an invalid request signature.","error":"AuthFailure.SignatureFailure: The provided credentials could not be validated because of an invalid signature."},{"fix":"Increase the request timeout in your ClientProfile's HttpProfile and verify network connectivity to Tencent Cloud API endpoints. Example: `httpProfile.reqTimeout = 60`.","cause":"The client failed to establish a connection to the Tencent Cloud API endpoint within the allotted time, likely due to network issues, firewall restrictions, or an unresponsive server.","error":"requests.exceptions.ConnectTimeout: HTTPSConnectionPool(...) timed out."},{"fix":"Consult the official Tencent Cloud API documentation for the specific service and action to ensure all request parameters and their values adhere to the required specifications.","cause":"One of the request parameters supplied to the Tencent Cloud API is invalid, not within the allowed range, or does not conform to the required format as specified by the API documentation.","error":"InvalidParameter.InvalidParameterValue: The parameter value 'xxx' is invalid for parameter 'yyy'."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"3.1.114","cli_name":"","cli_version":null,"type":"library","homepage":"https://www.tencentcloud.com","github":"https://github.com/TencentCloud/tencentcloud-sdk-python","docs":null,"changelog":null,"pypi":"https://pypi.org/project/tencentcloud-sdk-python/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["aws"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-28","install_tag":null}}