Tencent Cloud GPM SDK for Python
raw JSON → 3.0.1416 verified Sat May 09 auth: no python
Official Tencent Cloud SDK for Game Player Matchmaking (GPM) service. Version 3.0.1416, released regularly alongside other Tencent Cloud services. Enables integration with matchmaking rules, tickets, and matches.
pip install tencentcloud-sdk-python-gpm Common errors
error ModuleNotFoundError: No module named 'tencentcloud.gpm' ↓
cause Missing the service-specific package or incorrect import path.
fix
Install package: pip install tencentcloud-sdk-python-gpm; then use from tencentcloud.gpm.v20200820 import gpm_client
error AttributeError: module 'tencentcloud.gpm.v20200820' has no attribute 'gpm_client' ↓
cause Typo in module name (e.g., 'gpmclient' instead of 'gpm_client') or import of wrong symbol.
fix
import gpm_client from tencentcloud.gpm.v20200820 import gpm_client
Warnings
breaking The SDK uses versioned API paths (e.g., v20200820). Incorrect import leads to AttributeError. ↓
fix Use from tencentcloud.gpm.v20200820 import gpm_client
gotcha Models must be imported via `models` module; directly importing individual model classes may cause circular import errors. ↓
fix from tencentcloud.gpm.v20200820 import models; then use models.CreateMatchRequest()
deprecated Older documentation may reference `tencentcloud-sdk-python` directly. The package is now split per service. ↓
fix Install service-specific package: pip install tencentcloud-sdk-python-gpm
Imports
- GpmClient wrong
from tencentcloud.gpm import GpmClientcorrectfrom tencentcloud.gpm.v20200820 import gpm_client - models (e.g., CreateMatchRequest) wrong
from tencentcloud.gpm.v20200820.models import CreateMatchRequestcorrectfrom tencentcloud.gpm.v20200820 import models
Quickstart
import os
from tencentcloud.common import credential
from tencentcloud.gpm.v20200820 import gpm_client, models
cred = credential.Credential(
os.environ.get('TENCENTCLOUD_SECRET_ID'),
os.environ.get('TENCENTCLOUD_SECRET_KEY')
)
client = gpm_client.GpmClient(cred, "ap-guangzhou")
req = models.DescribeMatchRequest()
req.MatchCode = "your-match-code"
resp = client.DescribeMatch(req)
print(resp.to_json_string())