All Products
Search
Document Center

Simple Log Service:Install Simple Log Service SDK for Python

Last Updated:Apr 12, 2024

Before you can use Simple Log Service SDK for Python to call the API operations of Simple Log Service, you must install Simple Log Service SDK for Python. This topic describes how to install Simple Log Service SDK for Python.

Prerequisites

  • Simple Log Service is activated. For more information, see Activate Simple Log Service.

  • An AccessKey pair is created and obtained. For more information, see AccessKey pair.

    An Alibaba Cloud account has permissions to call all API operations. If you use the AccessKey pair of an Alibaba Cloud account, security risks may occur. We recommend that you create and use a RAM user to call API operations or perform routine O&M. Make sure that the RAM user is granted the permissions to perform operations on Simple Log Service resources. For more information, see Grant permissions to a RAM user.

  • A Python development environment is installed. For more information, visit the official website of Python.

    Simple Log Service SDK for Python supports PyPy 2 and PyPy 3 and the following Python versions: Python 2.6, Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8, and Python 3.9. You can run the python -V command to check the version of Python that is installed.

  • The pip tool is installed. You can use the tool to manage Python packages. For more information, visit the official website of pip.

    You can run the pip -V command to check the version of pip that is installed. If you use Python 3 or later, you must run the pip3 -V command. If pip is not installed, you can download the installation package from the official website of pip and then install pip.

    Note

    In Windows, if the 'pip' is not recognized as an internal or external command error appears, add the installation paths of Python and pip to the Path environment variable. In most cases, the installation path of pip is the Scripts folder in the Python installation directory. After you configure the settings, you may need to restart your computer to apply the environment variable.

Procedure

Run the following commands as an administrator in your CLI to install Simple Log Service SDK for Python:

pip install -U aliyun-log-python-sdk # If you use Python 2, run this command.
pip3 install -U aliyun-log-python-sdk # If you use Python 3, run this command.

If the following response is returned, the SDK is installed.

Successfully installed aliyun-log-python-sdk-0.6.54 certifi-2021.5.30 dateparser-1.0.0 elasticsearch-7.13.4 jmespath-0.10.0 protobuf-3.17.3 regex-2021.7.6 tzlocal-2.1

What to do next

Get started with Simple Log Service SDK for Python