Install
Runtime environment
- Operating environment The Python SDK can run in Python 2.7 and Python 3.x environments.
-
Authentication To use the Baidu AI Cloud products, you need a Baidu AI Cloud account, a valid AK (Access Key ID) and SK (Secret Access Key) for signature certification.
Plain Text1 Your AK/SK information can be obtained and understood through the following steps: 2 1. [Register a Baidu AI Cloud account](https://login.bce.baidu.com/reg.html?tpl=bceplat&from=portal) 3 4 2. [Create AK/SK](https://console.bce.baidu.com/iam/?_=1513940574695#/iam/accesslist)
Install SDK
Download and installation
Method I: Install via pip
You can install Baidu AI Cloud Python SDK into your environment via pip installation method. When connected to the network, execute the following command in the command line:
1pip install bce-python-sdk
You can now install the Python SDK to your local machine.
Method II: Download the source package locally for installation
- Download the Python SDk compression toolkit from Developer Resource Center.
-
Navigate the command line to the path where the compressed package is located, and execute the following command (replace version with the version number in the package name):
pip install bce-python-sdk-version.zip
You can now install the Python SDK to your local machine.
Alternatively, after decompressing the compressed package, you can execute the following command (replace version with the version number in the package name).
1cd bce-python-sdk-version
2
3python setup.py install
Complete the SDK installation process.
SDK directory structure
1com.baidubce
2 ├── auth //BCE signature classes
3 ├── http //BCE HTTP communication classes
4 ├── model // BCE common model classes
5 ├── services
6 │ └── blb //BLB service-related classes
7 │ ├── app_blb_client.py //APP BLB client entry class
8 │ └── blb_client.py //BLB client entry class
9 ├── bce_base_client.py //Base class for BCE client entry points
10 ├── bce_client_configuration.py //Configuration for BCE HttpClient
11 ├── bce_response.py //Request class for BCE client
12 ├── exception.py //BCE client exception class
13 ├── protocol.py //Network protocol definition
14 ├── region.py //Region processing module
15 ├── retry_policy.py //Common Configuration class for BCE service
16 └── utils.py //BCE common utilities
Uninstall SDK
Use pip to uninstall "bce-python-sdk" as intended.
