diff --git a/.gitignore b/.gitignore index 683bcd49a..c917b4bb0 100644 --- a/.gitignore +++ b/.gitignore @@ -51,4 +51,5 @@ golang/*.exe *.pyc *.pyo *.pyd +python/myvenv/ python/__pycache__/ \ No newline at end of file diff --git a/python/README-CN.md b/python/README-CN.md index a02e98c60..4b86b5e27 100644 --- a/python/README-CN.md +++ b/python/README-CN.md @@ -13,7 +13,23 @@ ## 快速开始 -在`rocketmq-clients/python`目录下使用命令:`pip install -r requirements.txt` 即可安装相关依赖库。 +推荐使用 Python 虚拟环境进行开发,可以按照以下步骤操作: + +首先切换到当前仓库的 `python` 子目录,然后执行以下命令创建一个新的虚拟环境: + +```sh +python3 -m venv myvenv +``` + +其次开始激活虚拟环境。激活方法取决于具体的操作系统: +* 对于Windows,执行:`myvenv\Scripts\activate.bat` +* 对于macOS/Linux:执行:`source myvenv/bin/activate` + +执行以下命令以安装所需的依赖库: + +```sh +pip install -r requirements.txt +``` ## 目前进展 diff --git a/python/README.md b/python/README.md index ee3888721..8ed72bd51 100644 --- a/python/README.md +++ b/python/README.md @@ -4,7 +4,7 @@ English | [简体中文](README-CN.md) | [RocketMQ Website](https://rocketmq.apa ## Overview -Here is the python implementation of the client for [Apache RocketMQ](https://rocketmq.apache.org/). Different from the [remoting-based client](https://github.com/apache/rocketmq/tree/develop/client), the current implementation is based on separating architecture for computing and storage, which is the more recommended way to access the RocketMQ service. +Here is the Python implementation of the client for [Apache RocketMQ](https://rocketmq.apache.org/). Different from the [remoting-based client](https://github.com/apache/rocketmq/tree/develop/client), the current implementation is based on separating architecture for computing and storage, which is the more recommended way to access the RocketMQ service. Here are some preparations you may need to know (or refer to [here](https://rocketmq.apache.org/docs/quickStart/02quickstart/https://rocketmq.apache.org/docs/quickStart/02quickstart/)). @@ -13,7 +13,23 @@ Here are some preparations you may need to know (or refer to [here](https://rock ## Getting Started -To install the relevant dependency libraries, use the command "pip install -r requirements.txt" in the directory "rocketmq-clients/python". +Clone the current repository to your local machine and set up a virtual environment for development, which will help you manage dependencies more efficiently. Follow the steps below: + +Navigate to the `python` subdirectory and execute the command below to create a new virtual environment: + +```sh +python3 -m venv myvenv +``` + +Activate the virtual environment. The activation method depends on your operating system: +* For Windows, execute: `myvenv\Scripts\activate.bat` +* For macOS/Linux: execute: `source myvenv/bin/activate` + +Install the required dependency libraries by executing the following command: + +```sh +pip install -r requirements.txt +``` ## Current Progress