Install Python agent in a UV environment

更新时间:
复制 MD 格式

This topic describes how to install and configure the Alibaba Cloud Python agent in a UV-based package management environment. After installing the agent, you can enable performance monitoring, tracing, and exception detection for your Python application.

Step 1: Download and extract the Python agent package

  1. Download the Python agent package.

    wget http://arms-apm-${regionID}.oss-${regionID}.aliyuncs.com/aliyun-python-agent/aliyun-python-agent.tar.gz

    Replace regionID with your region ID. For example:

    wget http://arms-apm-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/aliyun-python-agent/aliyun-python-agent.tar.gz

    Click to view how to specify a Python agent version

    To specify a Python agent version, run the following command:

    wget http://arms-apm-${regionID}.oss-${regionID}.aliyuncs.com/aliyun-python-agent/${version}/aliyun-python-agent.tar.gz

    Replace version with the Python agent version and regionID with the region ID. For example:

    wget http://arms-apm-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/aliyun-python-agent/2.6.4/aliyun-python-agent.tar.gz
  2. Extract the Python agent package.

    tar -zxvf aliyun-python-agent.tar.gz

Step 2: Use UV to install the Python agent package

uv pip install target/*.whl

Step 3: Use UV to run your Python application

uv run aliyun-instrument python3 app.py

References