SDK Installation Toolkit
The Python SDK toolkit can run in Python 2.7 and Python 3 environments.
2.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 execute
pip 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 the Python SDK compressed toolkit at Developer Resource Center.
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 unzip the package and execute the following command.(Replace version with the version number in the package name)
cd bce-python-sdk-version python setup.py install
SDK's directory structure
├── baidubce //BCE basic features, such as Request or Response │ └── auth //BCE's signature related class │ └── http //BCE's Http communication related class │ └── services │ └── cdn │ ├── cdn_client.py //CDN client entrance ├── sample //BCE unit test │ └── cdn │ └── cdn_sample.py //CDN unit test │ └── cdn_sample_conf.py //Configure HttpClient for CDN