diff --git a/docs/dev/python/datastream-api-users-guide/dependency_management.md b/docs/dev/python/datastream-api-users-guide/dependency_management.md index f14c71b2ca0c718e30dd2f0fa97173c20174791a..fffeed03e88454ecc54ed38ee9088d2b9cfdfc72 100644 --- a/docs/dev/python/datastream-api-users-guide/dependency_management.md +++ b/docs/dev/python/datastream-api-users-guide/dependency_management.md @@ -71,7 +71,7 @@ echo numpy==1.16.5 > requirements.txt pip download -d cached_dir -r requirements.txt --no-binary :all: # python code -stream_execution_environment.set_python_requirements("requirements.txt", "cached_dir") +stream_execution_environment.set_python_requirements("/path/to/requirements.txt", "cached_dir") {% endhighlight %}

Please make sure the installation packages matches the platform of the cluster and the python version used. These packages will be installed using pip, so also make sure the version of Pip (version >= 7.1.0) and the version of Setuptools (version >= 37.0.0).

@@ -86,9 +86,9 @@ stream_execution_environment.set_python_requirements("requirements.txt", "cached zip -r py_env.zip py_env # python code -stream_execution_environment.add_python_archive("py_env.zip") +stream_execution_environment.add_python_archive("/path/to/py_env.zip") # or -stream_execution_environment.add_python_archive("py_env.zip", "myenv") +stream_execution_environment.add_python_archive("/path/to/py_env.zip", "myenv") # the files contained in the archive file can be accessed in UDF def my_func(): @@ -103,9 +103,10 @@ def my_func():

Sets the path of the python interpreter which is used to execute the python udf workers, e.g., "/usr/local/bin/python3".

{% highlight python %} -stream_execution_environment.add_python_archive("py_env.zip") +stream_execution_environment.add_python_archive("/path/to/py_env.zip") stream_execution_environment.get_config().set_python_executable("py_env.zip/py_env/bin/python") {% endhighlight %} +

Please note that if the path of the python interpreter comes from the uploaded python archive, the path specified in set_python_executable should be a relative path.

Please make sure that the specified environment matches the platform that the cluster is running on.

diff --git a/docs/dev/python/datastream-api-users-guide/dependency_management.zh.md b/docs/dev/python/datastream-api-users-guide/dependency_management.zh.md index 2941b979037b9f4f52cb9706955acc8fe1081d29..66d7b271b84f998453e703b758cdb6aa8732d05c 100644 --- a/docs/dev/python/datastream-api-users-guide/dependency_management.zh.md +++ b/docs/dev/python/datastream-api-users-guide/dependency_management.zh.md @@ -72,7 +72,7 @@ echo numpy==1.16.5 > requirements.txt pip download -d cached_dir -r requirements.txt --no-binary :all: # Python 代码 -stream_execution_environment.set_python_requirements("requirements.txt", "cached_dir") +stream_execution_environment.set_python_requirements("/path/to/requirements.txt", "cached_dir") {% endhighlight %}

请确保这些依赖安装包和集群运行环境所使用的 Python 版本相匹配。此外,这些依赖将通过 Pip 安装, 请确保 Pip 的版本(version >= 7.1.0) 和 Setuptools 的版本(version >= 37.0.0)符合要求。

@@ -87,9 +87,9 @@ stream_execution_environment.set_python_requirements("requirements.txt", "cached zip -r py_env.zip py_env # python 代码 -stream_execution_environment.add_python_archive("py_env.zip") +stream_execution_environment.add_python_archive("/path/to/py_env.zip") # 或者 -stream_execution_environment.add_python_archive("py_env.zip", "myenv") +stream_execution_environment.add_python_archive("/path/to/py_env.zip", "myenv") # 归档文件中的文件可以被 Python 函数读取 def my_func(): @@ -104,9 +104,10 @@ def my_func():

配置用于执行 Python Worker 的 Python 解释器路径,如 "/usr/local/bin/python3"。

{% highlight python %} -stream_execution_environment.add_python_archive("py_env.zip") +stream_execution_environment.add_python_archive("/path/to/py_env.zip") stream_execution_environment.get_config().set_python_executable("py_env.zip/py_env/bin/python") {% endhighlight %} +

如果 Python 解释器的路径指向上传的 Python 归档文件,那么通过 set_python_executable 设置的 Python 解释器的路径必须是相对路径。

请确保配置的 Python 环境和集群运行环境匹配。

diff --git a/docs/dev/python/table-api-users-guide/dependency_management.md b/docs/dev/python/table-api-users-guide/dependency_management.md index 247f485dafb0f81e3ef57c1b5dd1a0c2a7c872e3..9eac7284490d8c43f76e45e05c9993fa89268a8b 100644 --- a/docs/dev/python/table-api-users-guide/dependency_management.md +++ b/docs/dev/python/table-api-users-guide/dependency_management.md @@ -71,7 +71,7 @@ echo numpy==1.16.5 > requirements.txt pip download -d cached_dir -r requirements.txt --no-binary :all: # python code -table_env.set_python_requirements("requirements.txt", "cached_dir") +table_env.set_python_requirements("/path/to/requirements.txt", "cached_dir") {% endhighlight %}

Please make sure the installation packages matches the platform of the cluster and the python version used. These packages will be installed using pip, so also make sure the version of Pip (version >= 7.1.0) and the version of SetupTools (version >= 37.0.0).

@@ -86,9 +86,9 @@ table_env.set_python_requirements("requirements.txt", "cached_dir") zip -r py_env.zip py_env # python code -table_env.add_python_archive("py_env.zip") +table_env.add_python_archive("/path/to/py_env.zip") # or -table_env.add_python_archive("py_env.zip", "myenv") +table_env.add_python_archive("/path/to/py_env.zip", "myenv") # the files contained in the archive file can be accessed in UDF def my_udf(): @@ -103,9 +103,10 @@ def my_udf():

Sets the path of the python interpreter which is used to execute the python udf workers, e.g., "/usr/local/bin/python3".

{% highlight python %} -table_env.add_python_archive("py_env.zip") +table_env.add_python_archive("/path/to/py_env.zip") table_env.get_config().set_python_executable("py_env.zip/py_env/bin/python") {% endhighlight %} +

Please note that if the path of the python interpreter comes from the uploaded python archive, the path specified in set_python_executable should be a relative path.

Please make sure that the specified environment matches the platform that the cluster is running on.

diff --git a/docs/dev/python/table-api-users-guide/dependency_management.zh.md b/docs/dev/python/table-api-users-guide/dependency_management.zh.md index f1a021bb186ff641b42dab37b5df51547401aeb4..2e03f6eaa00002fcd7351304f87cc331fb68d429 100644 --- a/docs/dev/python/table-api-users-guide/dependency_management.zh.md +++ b/docs/dev/python/table-api-users-guide/dependency_management.zh.md @@ -75,7 +75,7 @@ echo numpy==1.16.5 > requirements.txt pip download -d cached_dir -r requirements.txt --no-binary :all: # python 代码 -table_env.set_python_requirements("requirements.txt", "cached_dir") +table_env.set_python_requirements("/path/to/requirements.txt", "cached_dir") {% endhighlight %}

请确保这些依赖安装包和集群运行环境所使用的 Python 版本相匹配。此外,这些依赖将通过 Pip 安装, 请确保 Pip 的版本(version >= 7.1.0) 和 Setuptools 的版本(version >= 37.0.0)符合要求。

@@ -90,9 +90,9 @@ table_env.set_python_requirements("requirements.txt", "cached_dir") zip -r py_env.zip py_env # python 代码 -table_env.add_python_archive("py_env.zip") +table_env.add_python_archive("/path/to/py_env.zip") # 或者 -table_env.add_python_archive("py_env.zip", "myenv") +table_env.add_python_archive("/path/to/py_env.zip", "myenv") # 归档文件中的文件可以被 Python 函数读取 def my_udf(): @@ -107,9 +107,10 @@ def my_udf():

配置用于执行 Python Worker 的 Python 解释器路径,如 "/usr/local/bin/python3"。

{% highlight python %} -table_env.add_python_archive("py_env.zip") +table_env.add_python_archive("/path/to/py_env.zip") table_env.get_config().set_python_executable("py_env.zip/py_env/bin/python") {% endhighlight %} +

如果 Python 解释器的路径指向上传的 Python 归档文件,那么通过 set_python_executable 设置的 Python 解释器的路径必须是相对路径。

请确保配置的 Python 环境和集群运行环境匹配。