SDK Installation Toolkit
Environmental Preparation
-
Running environment
Python SDK supports running in environment of Python2.7 and Python3.
-
Install pycrypto reliance
Before installing SDK, it is needed to execute command
pip install pycrypto
first to install pycrypto reliance.
If the installation fails, please executepip install pycryptodome
Download and Install
Method 1: Install via pip
You can install the Baidu AI Cloud Python SDK into your environment through pip installation. Execute the following command on the command line in the networked state:
pip install bce-python-sdk
You can install the Python SDK locally.
Method 2: Download the source package locally and install it
- Download the Python SDK compressed toolkit at Developer Resource Center.
-
Move the command line to the path of the compressed package and execute the following command (version is replaced with the version number in the package name):
pip install bce-python-sdk-version.zip
You can install the Python SDK locally.
You can also execute the following command after decompressing the compressed package (version is replaced with the version number in the package name)
cd bce-python-sdk-version
python setup.py install
to complete the SDK installation.
SDK's directory structure
com.baidubce
├── auth // BCE's signature related class
├── http // BCE's Http communication related class
├── internal // SDK's internal class
├── model // BCE's public model class
├── services
│ └─ bcc // BCC service related classes
│ ├─ model // BCC internal model, such as Request or Response
│ ├─ BccClient.class // BCC client entry class
│ └─ BccClientConfiguration.class // Configuration for BCC-specific HttpClient
├── util // BCE's utility tool class
├── BceClientConfiguration.class // Configuration of BCE's HttpClient
├── BceClientException.class // Exception class of BCE's client
├── BceServiceException.class // The exception class after interacting with the BCE's server
├── ErrorCode.class // BCE's general error code
└── Region.class // BCE's service region
Uninstall SDK
It is expected that you can uninstall "bce-python-sdk" using pip when uninstalling the SDK.