This topic describes how to install a Python module.
Permissions
Only super administrators and system administrators can install, upgrade, or delete third-party Python packages.
Procedure
On the Dataphin home page, choose Management Center > System Settings from the top menu bar.
In the navigation pane on the left, choose Third-party Library Management > Python Module.
On the Python Third-party Packages page, click the Python Module tab, and then click + Add Python Module on the Python Module tab.
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 ([]).
ImportantThe 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 you enter a specific version, that version is installed. If you leave this parameter empty, the latest version is installed by default. If the version you enter does not exist, you can view the error details in the installation log.
Python Version
Select a Python version. Python 3.11, Python 3.7, and Python 2.7 are supported.
Installation Method
The online and upload installation methods are supported.
Upload installation: Install the Python module by uploading a resource file.
Online installation: Install the Python module by downloading it from a configured traffic mirror source.
Resource Type
For the upload installation method, select a resource type for the Python module. The resource types include *.whl and Custom installation package.
*.whl resource type: Compress the
*.whlfile of the module that you want to reference and the*.whlfiles of its dependencies into a.zippackage and upload it. The total size of the uploaded.zipfile cannot exceed 1 GB.ImportantThe 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*.whlfiles.Custom installation package: Upload a custom
.zipinstallation package file. The total size of the uploaded.zipfile cannot exceed 1 GB. The steps to create a custom installation package are as follows:Write the installation steps in the
setup.shorsetup.pyscript file. The Dataphin system directly executes this script file.Package the resource files required for the installation together with the
setup.shorsetup.pyfile into a.zippackage. Make sure that thesetup.shorsetup.pyfile is in the root directory of the installation package. Installation environment: CentOS 7, x86 64-bit.
Click OK.