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

Prerequisites

  • Python 2.x or Python 3.x is used.
  • Make sure that the python-pip dependency library is installed on the source server.
    In the examples, python3-pip is used. Run the following commands to install the python-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

Before you install the Alibaba Cloud SDK, make sure that you have downloaded and imported the Extension.Uploader utility class into your project.

  • If you are using Python 2.x, run the following commands to install the Alibaba Cloud SDK core library:
    sudo pip install aliyun-python-sdk-core==2.13.10
    pip install -v aliyun-python-sdk-green==3.6.6 // 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 Alibaba Cloud SDK core library:
    sudo pip install aliyun-python-sdk-core-v3==2.13.10
    pip install -v aliyun-python-sdk-green==3.6.6 // Install the SDK of the specified version. 
    pip install oss2 // Install the OSS dependency.