Registry / aws / tencentcloud-sdk-python-dc

tencentcloud-sdk-python-dc

JSON →
library3.1.83pypypi✓ verified 84d ago

Official Tencent Cloud SDK for Python, providing access to the Direct Connect (DC) service. Version 3.1.83, released weekly.

pip install tencentcloud-sdk-python-dc
INSTALL
IMPORT
SIG · TENCENTCLOUD-SDK-P
T
tencentcloud-sdk-python-dc
awspythonv3.1.83
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DcClient
from tencentcloud.dc.v20180410 import dc_client
from tencentcloud.dc import client
Versioned import path (v20180410) is required.

List all Direct Connect connections using credentials from environment variables.

import os from tencentcloud.common import credential from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException from tencentcloud.dc.v20180410 import dc_client, models try: cred = credential.Credential( os.environ.get('TENCENTCLOUD_SECRET_ID', ''), os.environ.get('TENCENTCLOUD_SECRET_KEY', '') ) client = dc_client.DcClient(cred, 'ap-guangzhou') req = models.DescribeDirectConnectsRequest() resp = client.DescribeDirectConnects(req) print(resp.to_json_string()) except TencentCloudSDKException as err: print(err)
Debug
Known issues
breakingThe SDK package structure changed in v3.0.0. Imports now require versioned subpackages (e.g., v20180410).
fix
Use from tencentcloud.dc.v20180410 import dc_client instead of old top-level paths.
affects: >=3.0.0 <4.0.0
deprecatedThe old credential provider (CommonClient) is deprecated; use credential.Credential with environment variables.
fix
Use credential.Credential(secret_id, secret_key) and set TENCENTCLOUD_SECRET_ID/KEY.
affects: >=3.0.0
gotchaThe SDK does not support async (asyncio) natively. Using it in async frameworks may cause blocking.
fix
Run requests in a thread pool or use a separate thread executor.
affects: all
gotchaRegion must be specified on client creation (e.g., 'ap-guangzhou'). Missing region leads to empty responses.
fix
Always pass the region string to DcClient(cred, region).
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'tencentcloud.dc'
Missing or incorrectly installed package; also the common package may be missing.
fix
Run: pip install tencentcloud-sdk-python-dc tencentcloud-sdk-python-common
AttributeError: module 'tencentcloud.dc' has no attribute 'v20180410'
The versioned subpackage is not available due to old SDK version or wrong import path.
fix
Upgrade to >=3.0.0: pip install --upgrade tencentcloud-sdk-python-dc
tencentcloud.common.exception.tencent_cloud_sdk_exception.TencentCloudSDKException: [TencentCloudSDKException] code: UnauthorizedOperation
Invalid or missing credentials (secret ID/key).
fix
Set environment variables TENCENTCLOUD_SECRET_ID and TENCENTCLOUD_SECRET_KEY correctly.
Upgrade
Version history
3.1.83latest on PyPI · released Apr 21, 2026
Audit
Dependencies
tencentcloud-sdk-python-commonrequiredRequired for all Tencent Cloud services.
Agent activity
31 hits · last 30 days
node
28
Resources
tencentcloud-sdk-python-dc — pip install tencentcloud-sdk-python-dc · libregistry