Registry / aws / aliyun-python-sdk-vpc

aliyun-python-sdk-vpc

JSON →
library3.0.48pypypi✓ verified 84d ago

The official Alibaba Cloud VPC (Virtual Private Cloud) SDK for Python, version 3.0.48, released on 2024-01-01. Provides APIs to manage VPC resources such as VPCs, vSwitches, route tables, and NAT gateways. Part of the Alibaba Cloud Python SDK family with monthly releases.

pip install aliyun-python-sdk-vpc
INSTALL
IMPORT
SIG · ALIYUN-PYTHON-SDK-
A
aliyun-python-sdk-vpc
awspythonv3.0.48
Install
4.2s avg
Import
290ms
Disk
42MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.0.48 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.298s · 43.4MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.2s · import 0.282s · 44MB
42MB installed
● package 42MB
Code
Verified usage

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

VpcRequest
from aliyunsdkvpc.request.v20160428.CreateVpcRequest import CreateVpcRequest
from aliyunsdkvpc.request.v20160428 import CreateVpcRequest
Import must explicitly reference the class from the module, not just the module.

Creates a VPC in cn-hangzhou region. Requires Alibaba Cloud credentials set in environment variables.

from aliyunsdkcore.client import AcsClient from aliyunsdkvpc.request.v20160428.CreateVpcRequest import CreateVpcRequest import os client = AcsClient( os.environ.get('ALIBABA_CLOUD_ACCESS_KEY_ID', ''), os.environ.get('ALIBABA_CLOUD_ACCESS_KEY_SECRET', ''), 'cn-hangzhou' ) request = CreateVpcRequest() request.set_VpcName('my-vpc') request.set_CidrBlock('10.0.0.0/16') response = client.do_action_with_exception(request) print(response.decode('utf-8'))
Debug
Known issues
breakingIn version 3.0.0+, all request classes must be imported from version-specific modules (e.g., v20160428). Direct imports from aliyunsdkvpc.request are deprecated and will raise ImportError.
fix
Use from aliyunsdkvpc.request.v20160428.<ApiName> import <ApiName>Request
affects: >=3.0.0
deprecatedThe method do_action() is deprecated in favor of do_action_with_exception(), which raises exceptions on API errors instead of returning error codes.
fix
Replace do_action() with do_action_with_exception()
affects: >=3.0.0
gotchaThe region ID must be specified when creating the client, not in each request. Setting region on the request object is ignored for VPC.
fix
Pass region to AcsClient constructor; do not use set_RegionId on request
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'aliyunsdkvpc'
The package is not installed or the import path is incorrect.
fix
Install: pip install aliyun-python-sdk-vpc. Then import from aliyunsdkvpc.
AttributeError: module 'aliyunsdkvpc.request' has no attribute 'v20160428'
Trying to import from the package without specifying the correct submodule path.
fix
Use the full import: from aliyunsdkvpc.request.v20160428.CreateVpcRequest import CreateVpcRequest
Upgrade
Version history
3.0.48latest on PyPI · released Feb 4, 2026
Audit
Dependencies
aliyun-python-sdk-core-v3requiredRequired for authentication and HTTP transport
Agent activity
45 hits · last 30 days
node
36
Perplexity
1
Resources
aliyun-python-sdk-vpc — pip install aliyun-python-sdk-vpc · libregistry