Install the SDK Package
Environment preparation
- Runtime environment
The Python SDK supports Python 2.7 and all Python 3.x versions.
- Install pycrypto dependency
Before installing the SDK, execute the command pip install pycrypto to install pycrypto dependency.
If installation fails, execute pip install pycryptodome.
Download and install SDK
Method I: Install via pip
You can install the Baidu AI Cloud Python SDK into your environment using the pip installation method. While connected to the internet, 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 to the folder containing the compressed package using the command line, then execute the following command (replace "version" with the version number in the package name): pip install bce-python-sdk-version.zip to install the Python SDK locally.
Alternatively, after decompressing the compressed package, you can execute the following command (replace version with the version number in the package name) to complete SDK installation:
1cd bce-python-sdk-version
2python setup.py install
SDK directory structure
1baidubce
2 ├── auth //Public permission directory
3 ├── http //Http request module
4 ├── services //Service public directory
5 │ └── iam //IAM directory
6 │ ├──iam_client.py //IAM client entry class
7 ├── bce_base_client.py //Base class for BCE client entry points
8 ├── bce_client_configuration.py //HttpClient configuration class
9 ├── bce_response.py //Request class for BCE client
10 ├── exception.py //BCE client exception class
11 ├── protocol.py //Network protocol definition
12 ├── region.py //Region processing module
13 ├── retry_policy.py //Common Configuration class for BCE service
14 └── utils.py //BCE common utilities
Uninstall SDK
Use pip to uninstall "bce-python-sdk" as intended.
