{"id":28351,"library":"tencentcloud-sdk-python-redis","title":"Tencent Cloud Redis SDK for Python","description":"Official Tencent Cloud SDK for managing Redis instances via their CREDIS API. Current version 3.1.78. Released frequently alongside the main tencentcloud-sdk-python monorepo.","status":"active","version":"3.1.78","language":"python","source_language":"en","source_url":"https://github.com/TencentCloud/tencentcloud-sdk-python","tags":["tencentcloud","redis","cloud-sdk","tencent"],"install":[{"cmd":"pip install tencentcloud-sdk-python-redis","lang":"bash","label":"PyPI"}],"dependencies":[{"reason":"Required for authentication and base client classes","package":"tencentcloud-sdk-python-common","optional":false}],"imports":[{"note":"Direct top-level import fails; must go through versioned module.","wrong":"from tencentcloud.redis import RedisClient","symbol":"RedisClient","correct":"from tencentcloud.redis.v20180412 import redis_client"},{"note":"models module is nested inside the versioned package.","wrong":"import models","symbol":"models","correct":"from tencentcloud.redis.v20180412 import models"}],"quickstart":{"code":"import os\nfrom tencentcloud.common import credential\nfrom tencentcloud.redis.v20180412 import redis_client, models\n\ncred = credential.Credential(\n    os.environ.get('TENCENTCLOUD_SECRET_ID', ''),\n    os.environ.get('TENCENTCLOUD_SECRET_KEY', '')\n)\nclient = redis_client.RedisClient(cred, 'ap-guangzhou')\nreq = models.DescribeInstancesRequest()\nresp = client.DescribeInstances(req)\nprint(resp.to_json_string())","lang":"python","description":"Authenticate and list Redis instances."},"warnings":[{"fix":"Use the versioned import as shown in quickstart. Old imports like `from tencentcloud.redis import RedisClient` will fail.","message":"In version 3.1.x, the client class moved from `redis_client.RedisClient` to the versioned path `tencentcloud.redis.v20180412.redis_client.RedisClient`.","severity":"breaking","affected_versions":">=3.1.0"},{"fix":"Always explicitly pass a region to the client constructor.","message":"The SDK silently uses a default region (often 'ap-guangzhou') if none is provided. This can cause unexpected API calls to the wrong region.","severity":"gotcha","affected_versions":"all"},{"fix":"Use the new variable names. The old ones still work but may be removed in future.","message":"The old credential environment variables (e.g., `TENCENTCLOUD_SECRET_ID` and `TENCENTCLOUD_SECRET_KEY`) are being replaced by `TENCENTCLOUD_ACCESS_KEY` and `TENCENTCLOUD_SECRET_ACCESS_KEY`.","severity":"deprecated","affected_versions":">=3.1.50"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Run `pip install tencentcloud-sdk-python-redis` (automatically pulls common).","cause":"Missing dependency: tencentcloud-sdk-python-redis is not installed, or the parent package tencentcloud-sdk-python-common is missing.","error":"ModuleNotFoundError: No module named 'tencentcloud.redis'"},{"fix":"Use explicit import: `from tencentcloud.redis.v20180412 import redis_client`.","cause":"Import path is incorrect; the version subpackage may not be loaded if using a top-level import.","error":"AttributeError: module 'tencentcloud.redis' has no attribute 'v20180412'"},{"fix":"Check that the region passed to RedisClient is a valid region code (e.g., 'ap-guangzhou'). Set environment variable or pass directly.","cause":"Region parameter is missing or invalid in the request.","error":"tencentcloud.common.exception.TencentCloudSDKException: [InvalidParameter] InvalidParameter"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}