安装BOSCLI
更新时间:2026-07-21
前提条件
BOS CLI 命令行工具(即 BCE CLI)基于 Python 2.7 开发,请根据操作系统安装相应的 Python 2.7,目前支持 Windows 和 Linux。
操作步骤
1. 准备 Python 环境
-
Windows 环境
在 Python 官网下载
python27.msi后,双击安装。 -
Linux 环境
以 Ubuntu 和 Redhat 为例,执行以下命令安装 Python 环境:
Ubuntu
sudo apt-get install python python-dev python-setuptools python-pip
Redhat
sudo yum install python python-dev python-setuptools python-pip
Plain Text
1> **说明:** 安装完 Python 后请先执行 `python -V` 查看 Python 版本信息,确保 Python 版本为 2.7 或之后的版本。对于使用百度智能云 BCC Centos6.5 系统的用户请按照后面的 **用百度智能云 BCC Centos6.5 系统的用户安装方法** 安装。
2
3### 2. 安装 BOS CLI 工具
4
5请先通过 [下载地址](https://cloud.baidu.com/doc/BOS/s/Ejwvyqobd#bos-cli%E4%B8%8B%E8%BD%BD%E5%9C%B0%E5%9D%80) 下载 BOS CLI 工具包。
6
7- Windows 环境
8
9 1. 解压 CLI 工具包。
10
11 2. 在 cmd 中执行如下命令:
12
13
14
15
16
17 ```shell
18cd $BCE_PATH
19python setup.py install
- 将
bce拷贝到用户需要执行程序的目录下,方便使用。
Shell
1python $YOUR_DIR/bce
-
Linux 环境
- 解压 CLI 工具包。
Shell1unzip bce-cli-0.10.8.zip
Plain Text
1 2. 将 `bcecli` 的库安装到系统的 Python 目录下。
2
3
4
5
6
7 ```shell
8python setup.py install
用百度智能云 BCC Centos6.5 系统的用户安装方法
- 首先下载 BCC Centos6.5镜像专用版CLI。
-
解压 CLI 工具包。
Shell1unzip bce-cli-0.10.8-centos6.5.zip
Plain Text
13. 将 `bce-cli-0.10.8-centos6.5` 的安装目录加入环境变量中。
2
3
4
5
6
7 ```shell
8export PATH=bce-cli-path:$PATH
说明: 比如
bce-cli-0.10.8-centos6.5.zip解压后的路径为/home/user1/bce-cli-0.10.8-centos6.5,您需要将路径/home/user1/bce-cli-0.10.8-centos6.5/加入环境变量中。
评价此篇文章
