Before you use Content Moderation SDK for Python, you must install pip and then use pip to install Python dependencies.

Prerequisites

  • Python 2.x or Python 3.x is used.
  • The python-pip dependency library is installed on the source server.
    Run the following commands to install the python3-pip dependency library for specific Linux distributions:
    • CentOS and Red Hat Enterprise Linux:
      yum -y install python3-pip
    • Ubuntu and Debian:
      apt-get -y install python3-pip
    • OpenSUSE and SUSE:
      zypper -n install python3-pip

Install the SDK

  • If you are using Python 2.x, run the following commands to install the SDK core library:
    sudo pip install aliyun-python-sdk-core==2.13.10
    pip install -v aliyun-python-sdk-green==3.6.1 // Install the SDK of the specified version.
    pip install oss2 // Install the Object Storage Service (OSS) dependency.
  • If you are using Python 3.x, run the following commands to install the SDK core library:
    sudo pip install aliyun-python-sdk-core-v3==2.13.10
    pip install -v aliyun-python-sdk-green==3.6.1 // Install the SDK of the specified version.
    pip install oss2 // Install the OSS dependency.
  • Download and import the Extension.Uploader utility class into your project if you submit a local or binary file for content moderation.