Updated on 2025-12-31 GMT+08:00

Obtaining and Installing Python SDKs

Installing Python SDKs

This section provides instructions on how to install Python SDKs.

Obtaining DLI SDKs

On the displayed DLI SDK DOWNLOAD page, click the target link to obtain the desired SDK installation package.

You are advised to also download the .sha256 file from the SDK installation package, as it can be used to verify the integrity of the SDK package. For details about the verification method, see Verifying the Integrity of the SDK Package.

Obtain the dli-sdk-python-x.x.x.zip package and decompress it. The following table shows the directory structure of the package.

Table 1 Directory structure

Parameter

Description

dli

DLI SDK basic module in the Python environment

examples

Python sample code

pyDLI

Implementation interface of PyHive

setup.py

Python SDK installation script

Verifying the Integrity of the SDK Package

When downloading the SDK installation package, you also need to download the .sha256 file to verify the integrity of the SDK package. This section outlines the steps to use the .sha256 file for verifying the integrity of the SDK package.

  1. Downloading the file
    1. Find the download link of the .sha256 file on the page for downloading the SDK installation package.

      Typically, the name of the .sha256 file is associated with the name of the SDK installation package. For example, if the name of the SDK installation package is dli-sdk-java-x.x.x, the corresponding .sha256 file may be dli-sdk-java-x.x.x.sha256.

    2. Download the SDK installation package and the .sha256 file separately to the local host, ensuring both files are saved in the same folder.
  2. Querying the SHA-256 hash value of the SDK installation package
    • On Windows
      1. Search for cmd in the Start menu to open the command window.
      2. Run cd to go to the directory where the SDK installation package is saved.

        For example, if the SDK installation package is saved in the SDK folder on drive D, enter cd D:\SDK.

      3. Run the following command:

        certutil -hashfile <SDK-installation-package-name> SHA256

        Replace <SDK-installation-package-name> with the actual SDK installation package name, for example, certutil -hashfile sdk - package.zip SHA256.

      4. After the command is executed, the command prompt will display the SHA-256 hash value of the SDK installation package.
    • On Linux
      1. Run cd to go to the directory where the SDK installation package is saved.

        For example, if the SDK installation package is saved in the SDK folder in the user's home directory, enter cd ~/SDK.

      2. Enter the query command:

        sha256sum <SDK-installation-package-name>

        Replace <SDK-installation-package-name> with the actual SDK installation package name, for example, sha256sum sdk - package.zip.

      3. After the command is executed, the terminal will display the SHA-256 hash value of the SDK installation package.
  3. Comparing hash values
    1. Open the downloaded .sha256 file using the text editor.
    2. Find the SHA-256 hash value of the SDK installation package in the .sha256 file.

      It is typically a long string, for example, a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6xxxxxxxxxxxxxxxxxxxxxxxx.

    3. Compare the SHA-256 hash value of the SDK installation package obtained in Querying the SHA-256 hash value of the SDK installation package with the hash value in the .sha256 file.
      • If the two hash values are identical, the SDK installation package was not altered during the download process and the file is intact.
      • If the hash values are inconsistent, an error occurred during the download of the SDK installation package or that the file was maliciously modified.

        In this case, you are advised to download the SDK installation package and its corresponding .sha256 file again and then verify the package.

Installing DLI Python SDKs

  1. Download and decompress the SDK installation package.

    Decompress dli-sdk-python-<version>.zip to a local directory that can be adjusted.

  2. Install the SDK.
    1. On a PC running Windows, choose Start > Run, enter cmd, and press Enter.
    2. In the command-line interface (CLI) window, access the windows directory in the directory where dli-sdk-python-<version>.zip is decompressed. For example, D:\tmp\dli-sdk-python-1.0.8.
    3. Run the following command to install DLI Python SDK (During the installation, the third-party dependencies are automatically downloaded):

      python setup.py install

      Figure 1 shows the installation result.

      Figure 1 Installing Python SDK