PAI SDK for Python provides easy-to-use high-level APIs and enables Artificial Intelligence (AI) and machine learning engineers to train and deploy models in Platform for AI (PAI) in an efficient manner. PAI SDK for Python is used in the entire AI and machine learning process.
Prerequisites
You have obtained an AccessKey pair.
You have created a workspace.
You have created an OSS bucket.
You need a Python 3.8 or later environment.
If you use the SDK as a RAM user, make sure that you have related permissions on the workspace and Object Storage Service (OSS) buckets.
To submit a training job in a workspace, a RAM user must be assigned a developer or administrator role of the workspace. For information about how to manage workspace members, see Manage members of the workspace.
To store assets such as code and models in OSS buckets, a RAM user must have read and write permissions on the OSS buckets. For more information, see the "Grant your RAM user or RAM role the permissions to access OSS" section in the Grant the permissions that are required to use Machine Learning Designer topic.
Install
Run the following command to install the PAI SDK for Python. Use Python 3.8 or later.
pip install "alipai>=0.4.0"Initialization Configuration
Run the following command on your CLI and perform the following operations to configure the required parameters:
# Run the following command in the CLI after the SDK is installed.
python -m pai.toolkit.configThe following example shows how to configure permissions using python -m pai.toolkit.config:

If an output similar to Configuration saved successfully: <Path to which the configurations are saved> is displayed, the configuration is complete.
References
After completing the initialization configuration, you can train a model. For more information, see Submit a training job.