Install the SDK Package

DNS

  • API Reference
    • API function release records
    • API Service Domain Name
    • Appendix
    • Common Headers and Error Responses
    • General Description
    • Interface Overview
    • Overview
    • Private DNS Related Interfaces
      • Add resolution record
      • Associate VPC
      • Create a PrivateZone
      • Delete PrivateZone
      • Delete resolution record
      • Disassociate VPC
      • Modify resolution record
      • Query details of a PrivateZone
      • Query PrivateZone list
      • Query resolution record list
      • Set Resolution Record Status
    • Public DNS Related Interfaces
      • Domain Name Related Interfaces
      • Line Group Related Interfaces
      • Resolution Records Related Interfaces
  • FAQs
    • General FAQs
  • Function Release Records
  • Operation guide
    • Identity and access management
    • Local DNS service
      • Add Private Zone
      • Add resolution record
      • Associate VPC
      • Delete Private Zone
      • Resolver
    • Public DNS service
      • Add domain name
      • Add resolution
      • Enable Resolution Service
      • Line Grouping Function
      • Manage Resolution
      • Resolution Line Selection
      • Upgrade Domain Name to Enterprise Edition Operation Guide
    • Resolution Logging Management
  • Product Description
    • Application scenarios
    • Product advantages
    • Product functions
    • Product overview
    • Usage restrictions
  • Product pricing
  • Quick Start
    • Activate Service
    • Use Resolution Service
  • SDK
    • Golang-SDK
      • Exception handling
      • Initialization
      • Install the SDK Package
      • Overview
      • Private DNS
      • Version history
    • Java-SDK
      • Install the SDK Package
      • Overview
      • Private DNS
      • Public DNS
      • Version history
    • Python-SDK
      • Initialization
      • Install the SDK Package
      • Overview
      • Private DNS
      • Public DNS
      • Version history
  • Service Level Agreement (SLA)
    • Internal DNS Service Level Agreement SLA
    • Public DNS Service Level Agreement SLA
  • Typical Practices
    • Implement URL Forwarding via Nginx
    • Local IDC Interconnection with Cloud DNS Service via Resolver
    • Quickly Set Up Private Domain Name Resolution Service Using Terraform
All documents
menu
No results found, please re-enter

DNS

  • API Reference
    • API function release records
    • API Service Domain Name
    • Appendix
    • Common Headers and Error Responses
    • General Description
    • Interface Overview
    • Overview
    • Private DNS Related Interfaces
      • Add resolution record
      • Associate VPC
      • Create a PrivateZone
      • Delete PrivateZone
      • Delete resolution record
      • Disassociate VPC
      • Modify resolution record
      • Query details of a PrivateZone
      • Query PrivateZone list
      • Query resolution record list
      • Set Resolution Record Status
    • Public DNS Related Interfaces
      • Domain Name Related Interfaces
      • Line Group Related Interfaces
      • Resolution Records Related Interfaces
  • FAQs
    • General FAQs
  • Function Release Records
  • Operation guide
    • Identity and access management
    • Local DNS service
      • Add Private Zone
      • Add resolution record
      • Associate VPC
      • Delete Private Zone
      • Resolver
    • Public DNS service
      • Add domain name
      • Add resolution
      • Enable Resolution Service
      • Line Grouping Function
      • Manage Resolution
      • Resolution Line Selection
      • Upgrade Domain Name to Enterprise Edition Operation Guide
    • Resolution Logging Management
  • Product Description
    • Application scenarios
    • Product advantages
    • Product functions
    • Product overview
    • Usage restrictions
  • Product pricing
  • Quick Start
    • Activate Service
    • Use Resolution Service
  • SDK
    • Golang-SDK
      • Exception handling
      • Initialization
      • Install the SDK Package
      • Overview
      • Private DNS
      • Version history
    • Java-SDK
      • Install the SDK Package
      • Overview
      • Private DNS
      • Public DNS
      • Version history
    • Python-SDK
      • Initialization
      • Install the SDK Package
      • Overview
      • Private DNS
      • Public DNS
      • Version history
  • Service Level Agreement (SLA)
    • Internal DNS Service Level Agreement SLA
    • Public DNS Service Level Agreement SLA
  • Typical Practices
    • Implement URL Forwarding via Nginx
    • Local IDC Interconnection with Cloud DNS Service via Resolver
    • Quickly Set Up Private Domain Name Resolution Service Using Terraform
  • Document center
  • arrow
  • DNS
  • arrow
  • SDK
  • arrow
  • Python-SDK
  • arrow
  • Install the SDK Package
Table of contents on this page
  • Runtime environment
  • Install SDK
  • Download and installation
  • Uninstall SDK

Install the SDK Package

Updated at:2025-11-11

Runtime environment

  1. Operating environment The Python SDK can run in Python 2.7 and Python 3.x environments.
  2. Authentication To use the Baidu AI Cloud products, you need a Baidu AI Cloud account, a valid AK (Access Key ID) and SK (Secret Access Key) for signature certification.

    Plain Text
    1	Your AK/SK information can be obtained and understood through the following steps:
    2	1. [Register a Baidu AI Cloud account](https://login.bce.baidu.com/reg.html?tpl=bceplat&from=portal)
    3
    4	2. [Create AK/SK](https://console.bce.baidu.com/iam/?_=1513940574695#/iam/accesslist)

Install SDK

Download and installation

Method I: Install via PIP

You can install the Baidu AI Cloud Python SDK into your environment via the PIP installation method. When connected to the network, execute the following command in the command line to install the Python SDK locally.

Plain Text
1pip install bce-python-sdk

Method II: Download the source package locally for installation

  1. Download the Python SDk compression toolkit from Developer Resource Center.
  2. Using the command line, navigate to the directory containing the compressed package and run the following command (replace "version" with the version number in the package name) to install the Python SDK locally.

    pip install bce-python-sdk-version.zip

Alternatively, after extracting the compressed package, execute the following command (replace "version" with the version number in the package name) to complete the SDK installation process.

Plain Text
1cd bce-python-sdk-version
2
3python setup.py install

SDK directory structure

Plain Text
1com.baidubce
2 ├── auth                                         //BCE signature classes
3 ├── http                                         //BCE HTTP communication classes
4       ├── services
5 │       └── dns                                 //Classes related to public DNS service
6 │           └── dns_client.py                   //Entry class for public DNS client
7 │       └── localdns                            //Classes related to local DNS service
8 │           └── ld_client.py                    //Entry class for local DNS client
9 ├── bce_base_client.py              //Base class for BCE client entry points
10 ├── bce_client_configuration.py                 //Configuration for BCE HttpClient
11 ├── bce_response.py                 //Request class for BCE client
12 ├── exception.py                    //BCE client exception class
13 ├── protocol.py                     //Network protocol definition
14 ├── region.py                       //Region processing module
15 ├── retry_policy.py                 //Common Configuration class for BCE service
16 └── utils.py                        //BCE common utilities

Uninstall SDK

Use PIP to uninstall "bce-python-sdk" as intended.

Previous
Initialization
Next
Overview