All Products
Search
Document Center

Dataphin:Install Python module

Last Updated:Jan 21, 2025

This topic explains the process of installing a Python module.

Permission description

Installation, upgrading, or deletion of Python third-party packages is restricted to super administrators and system administrators only.

Procedure

  1. On the Dataphin home page, navigate to the top menu bar and select Management Center > System Settings.

  2. In the left-side navigation pane, click on Third-party Library Management > Python Module.

  3. On the Python Module page, click the Python Module tab. Under the Python Module tab, click +install Python Module.

  4. In the Install Python Module dialog box, set the required parameters.

    Parameter

    Description

    Module Name

    Enter the Python module name. Only letters, numbers, underscores (_), hyphens (-), and periods (.) are supported.

    Important

    The module name and Python version must be globally unique. If the module name already exists under the selected Python version, installation is not supported.

    Module Version (optional)

    Enter the module version. Only letters, numbers, underscores (_), hyphens (-), and periods (.) are supported.

    If you enter a specified module version, the corresponding version will be installed. If not specified, the latest version will be installed by default. If the entered module version does not exist, you can view the specific error information in the installation log.

    Python Version

    Select the Python version. Python 3.11, Python 3.7, and Python 2.7 are supported.

    Installation Method

    Supports online installation and upload installation methods.

    • Upload installation: Install the Python module by uploading a resource file.

    • Online installation: Download the Python module from the configured traffic mirror source for installation.

    Resource Type

    The upload installation method requires selecting the resource type of the Python module. Includes *.whl and custom installation package.

    • *.whl resource type: Package the *.whl of the module to be directly referenced and the *.whl of its dependent modules into a .zip compressed package and upload it. The total size of the uploaded .zip file must not exceed 1 GB.

      Important

      The version of the *whl package must be compatible with the Python version, and the active environment is Linux (manylinux/none), with a CPU architecture of x86_64. It is recommended to obtain all *.whl files on a Linux system (such as CentOS) environment machine (x86_64) that can connect to the public network using the pip wheel [module_name] command.

    • Custom installation package: Upload a custom .zip installation package file. The total size of the uploaded .zip file must not exceed 1 GB. The steps for the custom installation package are as follows:

      1. Please write the installation steps in the setup.sh or setup.py script file. The Dataphin system will directly execute this script file.

      2. The resource files required for the installation process need to be packaged together with the setup.sh or setup.py into a .zip package. Also, ensure that setup.sh or setup.py is in the root directory of the installation package. Installation environment: CentOS 7, x86_64.

  5. To finalize the installation of the Python module, click OK.