Help Center/ ModelArts/ SDK Reference/ (Optional) Installing ModelArts SDK Locally
Updated on 2025-08-20 GMT+08:00

(Optional) Installing ModelArts SDK Locally

To use the ModelArts SDK on a PC or VM, install the ModelArts SDK in the target environment. After the installation, you can call the ModelArts SDK to easily manage datasets, create ModelArts training jobs and AI applications, and deploy the AI applications as real-time services.

ModelArts SDK Restrictions

The local ModelArts SDK does not support Debugging a Training Job. Currently, you can only debug it in notebook.

Procedure

To install the ModelArts SDK locally, perform the following operations:

ModelArts SDKs can be installed in Windows and Linux.

If an error occurred during the ModelArts SDK installation in Windows, rectify the fault by referring to FAQ: An Error Occurred During ModelArts SDK Installation.

Step 1: Download the ModelArts SDK Package

Contact technical support to obtain the ModelArts SDK software package of the latest version.

Step 2: Configure the Runtime Environment

  1. Check whether Python has been installed locally. If not, download Python of a proper version at the Python official website and install it. The Python version must be later than 3.7.x and earlier than 3.10.x. Version 3.7.x is recommended.
    Run the python --version command in the local environment. If the following information is displayed, Python has been installed:
    C:\Users\xxx>python --version
    Python *.*.*
  2. Check whether pip, package installer for Python, has been installed. If not, install pip by following the instructions provided at the pip official website after you install Python. It is recommended that the pip version be earlier than 24.0.
    Run the pip --version command in the local environment. If the following information is displayed, pip has been installed:
    C:\Users\xxx>pip --version
    pip **.*.* from c:\users\xxx\appdata\local\programs\python\python**\lib\site-packages\pip (python *.*)

    In Windows, if a message is displayed indicating that the command is not an internal or external command, add the Python and pip installation paths to Path in the environment variable. The pip installation path is typically the Scripts folder in the directory where Python is located.

    1. Press Win+R, enter sysdm.cpl in the Run dialog box, and click OK.
    2. In the System Properties dialog box, click the Advanced tab and click Environment Variables.
    3. In the User variables for area, double-click Path. In the Edit environment variable dialog box, click New and add the Python and pip installation paths. The installation path must point to the Scripts folder, for example, C:\python\python**\Scripts.
  3. 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

      The preceding information indicates that the pip folder needs to be created in 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.

      [global]
      index-url = https://pip.xxxx.com/repository/pypi/simple     
      trusted-host = pip.xxxx.com    
      disable-pip-version-check = true
      timeout = 120
      [install] 
      ignore-installed = true
      no-dependencies = yes
  4. Start cmd and run the following command to download the package of the required pip source:
    C:\Users\xxx>pip install numpy       # Replace numpy with the package you want to download.

Step 3: Install the ModelArts SDK

Start cmd and run the following command to install the ModelArts SDK:

pip install {Path to the SDK software package}\modelarts-latest-py2.py3-none-any.whl

C:\Users\xxx>pip install C:\Users\xxx\Downloads\modelarts-latest-py2.py3-none-any.whl
......
Successfully installed Pillow-*.*.0 ... modelarts-*.*.* ...

When SDK is installed, dependency packages are installed by default. If message "Successfully installed" is displayed, the ModelArts SDK has been installed. If the installation fails, rectify the fault by referring to FAQ: An Error Occurred During ModelArts SDK Installation.

If an error message is displayed during the installation, indicating that a dependency package is missing, run the following command to install the dependency package as prompted:

pip install xxxx

xxxx is the name of the dependency package.

Follow-Up Operations

After installing ModelArts SDKs locally, you need to complete session authentication. After session authentication is complete, you can directly call the ModelArts SDKs.

FAQ: An Error Occurred During ModelArts SDK Installation

  • When installing the ModelArts SDK in Windows, ensure the Python version is not later than 3.10.x. Python 3.7.x is recommended.

    If the error shown in the following figure is displayed when you install the SDK on the local computer, install the futures dependency package of version 3.1.1 and then reinstall the SDK.

    pip install futures==3.1.1
    Figure 1 Error message displayed during ModelArts SDK installation
  • If the pip version is later than or equal to 24.1, the installation package name will be verified. The following error may occur:
    ERROR: Invalid requirement: 'modelarts==latest': Expected end or semicolon (after name and no valid version specifier)
    modelarts==latest

    You can install pip of an earlier version, or replace latest in modelarts-latest-py2.py3-none-any.whl with any version number, for example, modelarts-1.0.0-py2.py3-none-any.whl. The actual version of the SDK is not affected.