百度智能云

All Product Document

          Cloud Compute Service

          Install the SDK Toolkit

          Environmental Preparation

          1. Running Environment

            Python SDK supports the running in the Python2.7 and Python3 environments. This document is the guidance document of Python2. If your development environment is Python3, see Python3-SDK.

          2. Install a pycrypto Dependency

            Run the commandpip install pycryptoto install the pycrypto dependency before the installation of SDK.

          Download and Install

          Mode 1: Install SDK through pip

          You can install the Baidu AI Cloud Python SDK to your environment through pip. Run the following commands from the command line online:

          pip install bce-python-sdk

          To install the Python SDK locally.

          Mode 2: Download the source package to install it locally

          1. Download the Python SDK compression package from the Developer Resource Center.
          2. Move the command line to the path of compression package, and then run the following command. The version is replaced with the version number in the package name:

             pip install bce-python-sdk-version.zip  

            To install the Python SDK locally.

          You can also decompress the compression package, and then run the following command . The version is replaced with the version number in the package name.

          cd bce-python-sdk-version
          
          python setup.py install 

          To complete the installation of SDK.

          SDK Directory Structure

          com.baidubce 
          ├── auth                                        //BCE signature related classes 
          ├── http                                        //BCE Http communication related classes 
          ├── internal                                    //SDK internal class 
          ├── model                                       //BCE public model class 
          ├── services 
          │    └─ bcc                                  //BCC service related class 
          │       ├─ model                            //BCC internal model, such as Request or Response 
          │       ├─ BccClient.class                  //BCC Client Entry Class 
          │       └─ BccClientConfiguration.class     //Configuration for BCC-specific HttpClient 
          ├── util                                       //BCE utility tools 
          ├── BceClientConfiguration.class               //Configuration of BCE's HttpClient 
          ├── BceClientException.class                   //BCE client exception class 
          ├── BceServiceException.class                  //The exception class after interacting with the BCE server 
          ├── ErrorCode.class                            //BCE general error code 
          └── Region.class       //Service region provided by BCE

          Uninstall a SDK

          When you want to uninstall the SDK, uninstall the "bce-python-sdk" through pip.

          Previous
          Overview
          Next
          Initialization