Before you can use Simple Log Service SDK for Python to perform operations on 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 the following versions of Python: PyPy 2, PyPy 3, Python 2.6, Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, and Python 3.7. You can run the python-V command to check the version of Python that is installed.
The pip tool is installed to manage Python packages. For more information, visit the official website of pip.
If pip is installed, you can run the pip-V command to check the version of pip that is installed. If pip is not installed, you can download the installation package from the official website of pip and then install pip.
NoteIn 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. The installation path of pip is in the Scripts folder in the Python installation directory. After you configure the settings, you may need to restart your computer to enable the environment variables.
Install Simple Log Service SDK for Python
Run the following command as an administrator in the command-line interface (CLI) to install Simple Log Service SDK for Python:
pip install -U aliyun-log-python-sdk
The following example shows a success response that is returned if Simple Log Service SDK for Python 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