Package org.apache.flink.python.util
Class PythonEnvironmentManagerUtils
java.lang.Object
org.apache.flink.python.util.PythonEnvironmentManagerUtils
Utils used to prepare the python environment.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetPythonUdfRunnerScript(String pythonExecutable, Map<String, String> environmentVariables) static StringgetPythonVersion(String pythonExecutable) static voidpipInstallRequirements(String requirementsFilePath, String requirementsCacheDir, String requirementsInstallDir, String pythonExecutable, Map<String, String> environmentVariables) Installs the 3rd party libraries listed in the user-provided requirements file.
-
Field Details
-
PYFLINK_UDF_RUNNER_DIR
- See Also:
-
-
Constructor Details
-
PythonEnvironmentManagerUtils
public PythonEnvironmentManagerUtils()
-
-
Method Details
-
pipInstallRequirements
public static void pipInstallRequirements(String requirementsFilePath, @Nullable String requirementsCacheDir, String requirementsInstallDir, String pythonExecutable, Map<String, String> environmentVariables) throws IOExceptionInstalls the 3rd party libraries listed in the user-provided requirements file. An optional requirements cached directory can be provided to support offline installation. In order not to populate the public environment, the libraries will be installed to the specified directory, and added to the PYTHONPATH of the UDF workers.- Parameters:
requirementsFilePath- The path of the requirements file.requirementsCacheDir- The path of the requirements cached directory.requirementsInstallDir- The target directory of the installation.pythonExecutable- The python interpreter used to launch the pip program.environmentVariables- The environment variables used to launch the pip program.- Throws:
IOException
-
getPythonUdfRunnerScript
public static String getPythonUdfRunnerScript(String pythonExecutable, Map<String, String> environmentVariables) throws IOException- Throws:
IOException
-
getPythonVersion
- Throws:
IOException
-