Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ ModelArts/ SDK Reference/ (Optional) Installing the ModelArts SDK Locally

(Optional) Installing the ModelArts SDK Locally

Updated on 2024-03-21 GMT+08:00

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.

Procedure

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

NOTE:

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 in Windows.

Step 1: Download the ModelArts SDK Package

  1. Download the ModelArts SDK software package of the latest version.
  2. (Optional) Verify the software package signature.
    1. Download the signature verification file of the software package.
    2. Run the following command to install OpenSSL and verify software consistency:
      openssl cms -verify -binary -in D:\modelarts-latest-py2.py3-none-any.whl.cms -inform DER -content D:\modelarts-latest-py2.py3-none-any.whl  -noverify > ./test
      NOTE:

      Replace the software package path in the example to the actual path.

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.
    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 *.*)
    NOTE:

    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. 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
  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.

NOTE:

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 in Windows

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

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback