All Products
Search
Document Center

ApsaraMQ for RocketMQ:Prepare the Python SDK environment

Last Updated:Mar 11, 2026

Set up your local environment to send and subscribe to messages with the ApsaraMQ for RocketMQ SDK for Python.

Prerequisites

  • Python 2.5 or later Download Python. To check your installed version, run:

    SDK versionPython version
    Later than v1.0.02.5 or later (Python 3.x supported)
    v1.0.02.5 or later, earlier than 3.0
      python -V
  • pip (Python package manager) Install pip.

    Note pip is bundled with Python 3.4 and later. If you run Python 3.4+, skip this step.

Install the SDK

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

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

       pip install mq_http_sdk
  3. Verify the installation: A successful installation displays the package name, version, and install path.

       pip show mq_http_sdk

What's next

Use the SDK to send and subscribe to messages. For more information, see the following topics:

  • Send messages

  • Subscribe to messages