{"id":28334,"library":"tencentcloud-sdk-python-emr","title":"TencentCloud SDK for Python - EMR","description":"Official Tencent Cloud SDK for the Elastic MapReduce (EMR) service, enabling management of EMR clusters, jobs, and resources. Current version 3.1.89, updated frequently alongside the core SDK.","status":"active","version":"3.1.89","language":"python","source_language":"en","source_url":"https://github.com/TencentCloud/tencentcloud-sdk-python","tags":["tencentcloud","emr","sdk","cloud"],"install":[{"cmd":"pip install tencentcloud-sdk-python-emr","lang":"bash","label":"PyPI"}],"dependencies":[{"reason":"Required for authentication and base client.","package":"tencentcloud-sdk-python-common","optional":false}],"imports":[{"note":"The client class is nested under the versioned module.","wrong":"from tencentcloud.emr import EmrClient","symbol":"EmrClient","correct":"from tencentcloud.emr.v20190103 import emr_client"}],"quickstart":{"code":"import os\nfrom tencentcloud.common import credential\nfrom tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException\nfrom tencentcloud.emr.v20190103 import emr_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 = emr_client.EmrClient(cred, \"ap-guangzhou\")\n    req = models.DescribeInstancesListRequest()\n    req.DisplayStrategy = \"clusterList\"\n    resp = client.DescribeInstancesList(req)\n    print(resp.to_json_string())\nexcept TencentCloudSDKException as err:\n    print(err)","lang":"python","description":"Initialize client and list EMR clusters."},"warnings":[{"fix":"Always set a valid region (e.g., 'ap-guangzhou').","message":"Region is required when initializing the client. Using an empty string or invalid region will raise TencentCloudSDKException.","severity":"gotcha","affected_versions":"all"},{"fix":"Install tencentcloud-sdk-python-emr and tencentcloud-sdk-python-common separately. Use 'from tencentcloud.common import credential'.","message":"Version 3.0.0 restructured the SDK into separate per-service packages. The emr package no longer contains common classes; import from tencentcloud-sdk-python-common.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Use credential.Credential(secret_id, secret_key) and pass it to the client.","message":"The old 'emr_client.EmrClient' initialization using SecretId/SecretKey directly is deprecated in favor of the Credential object.","severity":"deprecated","affected_versions":">=3.1.0"},{"fix":"Do not manually convert field names; use model instances with snake_case attributes.","message":"Model fields are snake_case in Python, but the API expects camelCase. The SDK handles conversion automatically when using to_json_string().","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":"pip install tencentcloud-sdk-python-common","cause":"Missing required package tencentcloud-sdk-python-common.","error":"ModuleNotFoundError: No module named 'tencentcloud'"},{"fix":"Set TENCENTCLOUD_SECRET_ID and TENCENTCLOUD_SECRET_KEY environment variables correctly.","cause":"Invalid or missing SecretId/SecretKey in environment or code.","error":"tencentcloud.common.exception.tencent_cloud_sdk_exception.TencentCloudSDKException: [TencentCloudSDKException] code: AuthFailure.SecretIdNotFound"},{"fix":"Use 'from tencentcloud.emr.v20190103 import emr_client'.","cause":"Import path is wrong; correct path uses dot notation.","error":"AttributeError: module 'tencentcloud.emr' has no attribute 'v20190103'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}