This topic describes how to install Python SDK and provides an operation example.


You can use PIP to install Python SDK or download the Python SDK package and add the package to the target project.

  • Use PIP to install Python SDK:
    pip install aliyun-python-sdk-ram
  • Download the Python SDK package:


The following is an example of how to create a RAM user by using Python SDK:

#!/usr/bin/env python

from aliyunsdkcore import client
from aliyunsdkram.request.v20150501 import CreateUserRequest

# Construct an Alibaba Cloud client to initiate a request.
# Set the access key ID and access key secret.
# Alibaba Cloud Resource Access Management (RAM) is a global service. Its API endpoint is China (Hangzhou). Here, set "Region" to "cn-hangzhou".
clt = client.AcsClient('<access-key-id>','<access-key-secret>','cn-hangzhou')

# Construct the "CreateUser" request.
request = CreateUserRequest.CreateUserRequest()
# Set the "UserName" parameter.

# Initiate a request and obtain a response.
response = clt.do_action(request)

print response