Updated on 2026-11-06 GMT+08:00

Preparing a Local Development Environment

If the built-in operators cannot meet your data processing requirements, you can develop custom operators. Before developing an operator, you must prepare a local development environment. This section describes how to install the development tool and operator development SDK.

Installing the Development Tool and Operator Development SDK

  1. Download and install PyCharm IDEA (Community Edition) or your preferred Python IDE.
  2. Install Python 3.10.
    1. Download the Python 3.10.x installation package from the Python official website and select Add Python to PATH during the installation.
    2. After the installation is complete, verify the installation on the terminal:
      python --version

      Expected output:

      Python 3.10.x
  3. Install the general Python package management tool pip. If not, install pip by following the instructions provided at the pip official website after you install Python.

    Take the Windows environment as an example. Run the pip --version command in the local environment. If the following information is displayed, pip has been installed:

    C:\Users\xxxx>pip --version
    pip xx.x.x from D:\Python\py310\lib\site-packages\pip (python 3.10)
  4. Configure the pip source. The following uses Windows as an example to describe how to configure the pip source:
    1. Create a pip folder. Start cmd and run the set command to view the AppData path. Create a pip folder in the obtained AppData path. An example is provided as follows:
      C:\Users\xxx>set
      ALLUSERSPROFILE=C:\ProgramData
      APPDATA=C:\Users\xxx\AppData\Roaming
    2. Create a text file named pip in the pip folder and change the file name extension from .txt to .ini. An example is provided as follows:

      index-url is the IP address of the pip source, which needs to be replaced as required. The following uses a Huawei source as an example.

      [global]
      index-url = https://mirrors.huaweicloud.com/repository/pypi/simple  
      trusted-host = mirrors.huaweicloud.com  
      disable-pip-version-check = true
      timeout = 120
      [install] 
      ignore-installed = true
      no-dependencies = yes
  5. Install the operator development SDK.
    1. Download the ModelArts data refinement SDK software package for developing custom operators.
    2. Install the SDK using pip. To do so, run this command:
      pip install modelarts_data_refiner-1.0.0-py3-none-any.whl
    3. After the installation is complete, check whether the installation is successful.
      python -c "from modelarts.data.refiner.op.base_op import Mapper, Filter, BatchMapper, BatchFilter, Generator; print('SDK installed successfully')"

      Expected output:

      SDK installed successfully