Installing Command Line Tools
Introduction
Xiaomi Cloud-ML provides a cross-platform command line tool that supports the Mac/Linux/Windows operating systems. It can also access services using command lines.
Environmental Dependence
Cloud-ML requires Python 2.7 and is recommended to be used in virtualenv-isolated python virtual environment. To install the command line client, please install the following system dependencies, and upgrade pip at the same time:
## install system dependency
sudo apt-get install build-essential libssl-dev libffi-dev python-dev
## install latest pip
wget "https://bootstrap.pypa.io/get-pip.py"
sudo python get-pip.py
## check pip version is latest, should be 9.0.1
pip -V
## install Cloud-ML-SDK
sudo pip install cloud-ml-sdk
## check cloud-ml-sdk version
cloudml -v
Local Installation
pip install cloud-ml-sdk
The operating system in use may be different. Please refer to [system installation] (./install.md# system installation).
Configure Auto Complete
Execute the following commands, and add the eval command to the environment variable, so that cloudml command can be used to autocomplete.
sudo activate-global-python-argcomplete
eval "$(register-python-argcomplete cloudml)"
Using Docker
We also recommend using Docker to execute commands. You can use it without installing any dependencies. Just execute the following command.
sudo docker run -i -t -v $HOME/.config/xiaomi/config:/root/.config/xiaomi/config cr.d.xiaomi.net/cloud-ml/cloud_ml_sdk bash
Frequently Asked Questions
Upgrading Clients
Some functions can only be implemented in the new version of the client. To upgrade the client, use the following command.
pip install --upgrade cloud-ml-sdk