All Products
Search
Document Center

ApsaraMQ for RocketMQ:Environment preparation

Last Updated:Oct 08, 2026

Install the ApsaraMQ for RocketMQ Python SDK and prepare the resources you need to send and receive messages.

Prerequisites

  • Python 3.7 or later. Download from python.org.

  • An ApsaraMQ for RocketMQ instance with the following resources created in the console. For instructions, see Create resources.

    • Instance

    • Topic

    • Consumer group

Install the SDK

  1. Create and activate a virtual environment to isolate dependencies:

       python -m venv .venv
       source .venv/bin/activate        # Linux or macOS
       .venv\Scripts\activate           # Windows
  2. Install the rocketmq-python-client package:

       pip install rocketmq-python-client==5.1.1

Next steps