{"id":7920,"library":"aliyun-python-sdk-core-v3","title":"Aliyun Python SDK Core V3","description":"The `aliyun-python-sdk-core-v3` library provides the foundational components for interacting with Alibaba Cloud services using Python. It includes core functionalities like client initialization (`AcsClient`), request signing, and common request structures, upon which service-specific SDKs are built. The current version is 2.13.33, with releases occurring irregularly but consistently to support new features and fixes across Alibaba Cloud's ecosystem.","status":"active","version":"2.13.33","language":"python","source_language":"en","source_url":"https://github.com/aliyun/aliyun-openapi-python-sdk","tags":["aliyun","alibaba-cloud","sdk","cloud","openapi"],"install":[{"cmd":"pip install aliyun-python-sdk-core-v3","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"note":"The actual import path is 'aliyunsdkcore', not directly reflecting the PyPI package name 'aliyun-python-sdk-core-v3'.","wrong":"from aliyun_python_sdk_core_v3.client import AcsClient","symbol":"AcsClient","correct":"from aliyunsdkcore.client import AcsClient"},{"note":"The actual import path is 'aliyunsdkcore', not directly reflecting the PyPI package name 'aliyun-python-sdk-core-v3'.","wrong":"from aliyun_python_sdk_core_v3.request import CommonRequest","symbol":"CommonRequest","correct":"from aliyunsdkcore.request import CommonRequest"}],"quickstart":{"code":"import os\nfrom aliyunsdkcore.client import AcsClient\nfrom aliyunsdkcore.request import CommonRequest\n\n# Get credentials from environment variables or provide them directly\naccess_key_id = os.environ.get('ALIYUN_AK_ID', 'YOUR_ACCESS_KEY_ID')\naccess_key_secret = os.environ.get('ALIYUN_AK_SECRET', 'YOUR_ACCESS_KEY_SECRET')\nregion_id = os.environ.get('ALIYUN_REGION', 'cn-hangzhou')\n\n# Initialize the AcsClient\nclient = AcsClient(access_key_id, access_key_secret, region_id)\n\n# Create a CommonRequest for a service (e.g., ECS - DescribeRegions)\nrequest = CommonRequest()\nrequest.set_domain('ecs.aliyuncs.com') # Example: ECS service domain\nrequest.set_version('2014-05-26')      # Example: API version\nrequest.set_action_name('DescribeRegions') # Example: API action\nrequest.set_method('POST')             # Example: HTTP method\n\n# Send the request and print the response\ntry:\n    response = client.do_action_with_exception(request)\n    print(f\"API Response: {response.decode('utf-8')}\")\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")","lang":"python","description":"This quickstart demonstrates how to initialize the `AcsClient` with credentials and make a generic `CommonRequest` to an Alibaba Cloud service (e.g., listing ECS regions). It emphasizes using environment variables for sensitive data."},"warnings":[{"fix":"Always use `from aliyunsdkcore.client import AcsClient` and `from aliyunsdkcore.request import CommonRequest`.","message":"The import path `aliyunsdkcore` does not directly reflect the PyPI package name `aliyun-python-sdk-core-v3`. This is a common source of `ModuleNotFoundError`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Update your API calls to use `do_action_with_exception` and wrap them in a try-except block to handle potential `ClientException` or `ServerException`.","message":"For robust error handling, always prefer `client.do_action_with_exception(request)` over the older `client.do_action(request)`. The latter can silently fail or return incomplete responses without raising an exception.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure your `ALIYUN_AK_ID`, `ALIYUN_AK_SECRET`, and `ALIYUN_REGION` environment variables are correctly set and correspond to active, valid credentials and a region that supports the requested service.","message":"Authentication failures are common due to incorrect `AccessKeyId`, `AccessKeySecret`, or an unsupported `region_id`. Errors like `InvalidAccessKeyId.NotFound` or `SignatureDoesNotMatch` indicate credential issues.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-06-07T17:54:58.209Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Ensure the package is correctly installed: `pip install aliyun-python-sdk-core-v3`. Verify your import statements are `from aliyunsdkcore.client import AcsClient` etc.","cause":"The Python interpreter cannot find the `aliyunsdkcore` module. This usually happens if the `aliyun-python-sdk-core-v3` package was not installed or an incorrect import path was used.","error":"No module named 'aliyunsdkcore'"},{"fix":"Double-check your `ALIYUN_AK_ID` environment variable or the hardcoded `access_key_id` value against your Alibaba Cloud RAM console. Generate a new AccessKey if necessary.","cause":"The `AccessKeyId` provided to the `AcsClient` is either incorrect, expired, or does not exist in your Alibaba Cloud account.","error":"Server Exception: Code: InvalidAccessKeyId.NotFound"},{"fix":"Verify your `ALIYUN_AK_SECRET` environment variable or the hardcoded `access_key_secret` value. Pay close attention to typos, leading/trailing spaces, and ensure it matches the correct `AccessKeyId`.","cause":"The `AccessKeySecret` provided does not match the `AccessKeyId`, leading to a failed signature verification.","error":"Server Exception: Code: SignatureDoesNotMatch"},{"fix":"Consult the official Alibaba Cloud documentation for the specific service (e.g., ECS, OSS) to find the list of supported regions for the API you are using, and update your `ALIYUN_REGION` or client initialization accordingly.","cause":"The specified `region_id` (e.g., 'cn-hangzhou') does not support the specific Alibaba Cloud service or API action you are attempting to call.","error":"Server Exception: Code: UnsupportedRegion"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"2.13.33","cli_name":"","cli_version":null,"type":"library","homepage":"https://www.aliyun.com","github":"https://github.com/aliyun/aliyun-openapi-python-sdk","docs":null,"changelog":null,"pypi":"https://pypi.org/project/aliyun-python-sdk-core-v3/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["aws"],"base_url":null,"auth_type":null,"install_checks":{"last_tested":"2026-06-07","tag":null,"tag_description":null,"installed_version":"2.13.33","pypi_latest":"2.13.33","is_stale":false,"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"aliyun-python-sdk-core-v3","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"noisy","install_time_s":null,"import_time_s":0.41,"mem_mb":12.5,"disk_size":"39.1M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"aliyun-python-sdk-core-v3","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"noisy","install_time_s":3.5,"import_time_s":0.3,"mem_mb":12.5,"disk_size":"40M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"aliyun-python-sdk-core-v3","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"noisy","install_time_s":null,"import_time_s":0.51,"mem_mb":13.3,"disk_size":"42.1M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"aliyun-python-sdk-core-v3","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"noisy","install_time_s":3.2,"import_time_s":0.48,"mem_mb":13.3,"disk_size":"43M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"aliyun-python-sdk-core-v3","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"31.9M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"aliyun-python-sdk-core-v3","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"broken","install_time_s":4.1,"import_time_s":null,"mem_mb":null,"disk_size":"32M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"aliyun-python-sdk-core-v3","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"31.7M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"aliyun-python-sdk-core-v3","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"broken","install_time_s":3.9,"import_time_s":null,"mem_mb":null,"disk_size":"32M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"aliyun-python-sdk-core-v3","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.33,"mem_mb":12.3,"disk_size":"39.5M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"aliyun-python-sdk-core-v3","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"clean","install_time_s":4,"import_time_s":0.32,"mem_mb":12.3,"disk_size":"40M"}]},"_links":{"self":"https://checklist.day/api/registry/aliyun-python-sdk-core-v3","v1":"https://checklist.day/v1/registry/aliyun-python-sdk-core-v3","v1_install":"https://checklist.day/v1/registry/aliyun-python-sdk-core-v3/install","v1_imports":"https://checklist.day/v1/registry/aliyun-python-sdk-core-v3/imports","v1_compatibility":"https://checklist.day/v1/registry/aliyun-python-sdk-core-v3/compatibility","v1_quickstart":"https://checklist.day/v1/registry/aliyun-python-sdk-core-v3/quickstart","docs":"https://checklist.day/docs"}}