Install Toolkit
Environment Preparation
- Running environment
Python SDK toolkit is supported to run in the environment of Python 2.7 and Python 3. -
Install pycrypto reliance
Before installing SDK, it is needed to execute command
pip install pycrypto
first to install pycrypto reliance.
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.
Method 3: Use setup.py install document for installation
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
SDK's directory structure
baidubce
├── auth //Public permission directory
├── http //Http request module
├── services //Service public directory
│ └── bcm //BCM directory
│ ├──bcm_client.py //BCM Client entry class
├── bce_base_client.py //Base class of BCE client entry class
├── bce_client_configuration.py //HttpClient configuration class of BCE client
├── bce_response.py //BCE client request class
├── exception.py //BCE client exception class
├── protocol.py //Network protocol definition
├── region.py //Regional processing module
├── retry_policy.py //BCE service public configuration
└── utils.py //BCE public tool class
Uninstall SDK
When uninstalling SDK, execute the command pip uninstall bce-python-sdk
to uninstall it.