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
-
On the Dataphin home page, navigate to the top menu bar and select Management Center > System Settings.
-
In the left-side navigation pane, click on Third-party Library Management > Python Module.
-
On the Python Module page, click the Python Module tab. Under the Python Module tab, click +install Python Module.
-
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.
ImportantThe 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
*.whlof the module to be directly referenced and the*.whlof its dependent modules into a.zipcompressed package and upload it. The total size of the uploaded.zipfile must not exceed 1 GB.ImportantThe 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
*.whlfiles on a Linux system (such as CentOS) environment machine (x86_64) that can connect to the public network using thepip wheel [module_name]command.Custom installation package: Upload a custom
.zipinstallation package file. The total size of the uploaded.zipfile must not exceed 1 GB. The steps for the custom installation package are as follows:Please write the installation steps in the
setup.shorsetup.pyscript file. The Dataphin system will directly execute this script file.The resource files required for the installation process need to be packaged together with the
setup.shorsetup.pyinto a.zippackage. Also, ensure thatsetup.shorsetup.pyis in the root directory of the installation package. Installation environment: CentOS 7, x86_64.
-
To finalize the installation of the Python module, click OK.