{"id":23238,"library":"alibabacloud-vpc20160428","title":"Alibaba Cloud VPC SDK for Python","description":"Alibaba Cloud Virtual Private Cloud (VPC) SDK for Python, version 7.1.1. Provides APIs to manage VPC resources such as VPCs, vSwitches, route tables, and NAT gateways. Released frequently alongside Alibaba Cloud API updates. Requires Python >=3.7.","status":"active","version":"7.1.1","language":"python","source_language":"en","source_url":"https://github.com/aliyun/alibabacloud-python-sdk","tags":["alibaba-cloud","vpc","sdk","networking","alibabacloud"],"install":[{"cmd":"pip install alibabacloud-vpc20160428","lang":"bash","label":"PyPI"}],"dependencies":[{"reason":"Required for authentication using AccessKey or STS token.","package":"alibabacloud_credentials","optional":false},{"reason":"Core OpenAPI client library.","package":"alibabacloud_tea_openapi","optional":false}],"imports":[{"note":"Client is in the client submodule, not at package top level.","wrong":"from alibabacloud_vpc20160428 import Client","symbol":"Client","correct":"from alibabacloud_vpc20160428.client import Client"}],"quickstart":{"code":"import os\nfrom alibabacloud_credentials.client import Client as CredentialClient\nfrom alibabacloud_vpc20160428.client import Client\nfrom alibabacloud_tea_openapi import models as open_api_models\n\n# Setup credentials\ncred_config = open_api_models.Config()\ncred_config.access_key_id = os.environ.get('ALIBABA_CLOUD_ACCESS_KEY_ID', '')\ncred_config.access_key_secret = os.environ.get('ALIBABA_CLOUD_ACCESS_KEY_SECRET', '')\ncred_client = CredentialClient(cred_config)\n\n# Create VPC client\nconfig = open_api_models.Config(\n    credential=cred_client,\n    # Optional: read region from env or set here\n    region_id=os.environ.get('ALIBABA_CLOUD_REGION_ID', 'cn-hangzhou')\n)\nclient = Client(config)\n\n# Example call: DescribeVpcs\nfrom alibabacloud_vpc20160428 import models as vpc_models\nrequest = vpc_models.DescribeVpcsRequest(\n    region_id=config.region_id,\n    page_size=10\n)\nresponse = client.describe_vpcs(request)\nprint(response.to_map())","lang":"python","description":"Initialize the VPC client and call DescribeVpcs to list VPCs."},"warnings":[{"fix":"Uninstall the old package 'aliyun-python-sdk-vpc' and install 'alibabacloud-vpc20160428'. Update imports to 'alibabacloud_vpc20160428...'","message":"In version 7.0.0, the package name changed from 'aliyun-python-sdk-vpc' to 'alibabacloud-vpc20160428' and import paths completely changed.","severity":"breaking","affected_versions":"<7.0.0"},{"fix":"Create a CredentialClient using alibabacloud_credentials and pass to the VPC client via the 'credential' parameter.","message":"The use of 'access_key_id' and 'access_key_secret' directly in client config is deprecated in favour of providing a CredentialClient instance.","severity":"deprecated","affected_versions":">=7.0.0"},{"fix":"Set region_id in the open_api_models.Config before creating the client, or set it in the request object.","message":"Region ID is required for most API calls. If not set in client config, you must pass it per request. Omitting can lead to a 'region not found' error.","severity":"gotcha","affected_versions":">=7.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'pip install alibabacloud-vpc20160428' or check that you are using the correct virtual environment.","cause":"Package not installed or wrong Python environment.","error":"ModuleNotFoundError: No module named 'alibabacloud_vpc20160428'"},{"fix":"Use 'from alibabacloud_vpc20160428.client import Client'","cause":"Importing Client from the package root instead of the correct submodule.","error":"AttributeError: module 'alibabacloud_vpc20160428' has no attribute 'Client'"},{"fix":"Set region_id in the Config object when creating the client, or pass it in the request parameters.","cause":"Region ID not set in client or request.","error":"SDK.ServerError: The specified region does not exist."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}