Install a Python module

更新时间:
复制 MD 格式

You can install third-party Python modules in Dataphin to extend data processing capabilities.

Permissions

Only super administrators and system administrators can install, upgrade, or delete third-party Python packages.

Procedure

  1. On the Dataphin home page, choose Management Center > System Settings from the top menu bar.

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

  3. On the Python Third-party Packages page, click the Python Module tab, and then click + Add Python Module on the Python Module tab.

  4. In the Install Python Module dialog box, configure the following parameters.

    Parameter

    Description

    Module Name

    Enter a name for the Python module. The name can contain only letters, digits, underscores (_), hyphens (-), periods (.), and square brackets ([]).

    Important

    The combination of the module name and Python version must be globally unique. If a module with the same name already exists for the selected Python version, the installation is not supported.

    Module Version (Optional)

    Enter the module version. The version can contain only letters, digits, underscores (_), hyphens (-), and periods (.).

    If specified, that version is installed. If left empty, the latest version is installed by default. If the specified version does not exist, error details are available in the installation log.

    Python Version

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

    Installation Method

    Two installation methods are available:

    • Upload installation: Upload a resource file to install the module.

    • Online installation: Download and install the module from a configured traffic mirror source.

    Resource Type

    When using upload installation, select a resource type. Available types are *.whl and Custom installation package.

    • *.whl resource type: Package the *.whl file of the target module and the *.whl files of its dependencies into a .zip file and upload it. The .zip file cannot exceed 1 GB.

      Important

      The wheel package version must be compatible with the Python version. The environment must be Linux (manylinux/none) and the CPU architecture must be x86 64-bit. Run the pip wheel [module_name] command on an x86 64-bit machine that runs a Linux operating system, such as CentOS, and is connected to the public network to obtain all *.whl files.

    • Custom installation package: Upload a custom .zip installation package. The .zip file cannot exceed 1 GB. To create a custom installation package:

      1. Write the installation steps in the setup.sh or setup.py script file. The Dataphin system directly executes this script file.

      2. Package the resource files required for the installation together with the setup.sh or setup.py file into a .zip package. Make sure that the setup.sh or setup.py file is in the root directory of the installation package. Installation environment: CentOS 7, x86 64-bit.

  5. Click OK.