SDK Installation
Last Updated:2020-09-01
Runtime Environment
- Python SDK supports operation in the environment of Python2.7 and Python3.
- Before installing SDK, you need to execute command
pip install pycrypto
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
1.Download Python SDK in Official Website. 2.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
baidubce
├── auth // Public permission directory
├── http //Http request module
├── services // Service public directory
│ └── eip //EIP Directory
│ ├──eip_client.py //EIP Client entry class
│ ├──model.py //EIP internal model, such as Billing
│ ├──eip_group_client.py //EIPGroup client entry class
│ └──eip_group_model.py //EIPGroup internal model, such as Billing
├── bce_base_client.py // Base class of BCE client entry class
├── bce_client_configuration.py //HttpClient configuration class
├── 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
It is expected that you can uninstall "bce-python-sdk" using pip when uninstalling the SDK.