You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by di...@apache.org on 2023/06/15 12:15:00 UTC

[flink] branch release-1.17 updated: [FLINK-32034][python] Fix GET_SITE_PACKAGES_SCRIPT for Python 3.10

This is an automated email from the ASF dual-hosted git repository.

dianfu pushed a commit to branch release-1.17
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/release-1.17 by this push:
     new dd1dde377f7 [FLINK-32034][python] Fix GET_SITE_PACKAGES_SCRIPT for Python 3.10
dd1dde377f7 is described below

commit dd1dde377f775c43fcd95eed1bae91bf5fcfee2e
Author: Colten Pilgreen <co...@gmail.com>
AuthorDate: Wed Jun 14 15:14:05 2023 -0500

    [FLINK-32034][python] Fix GET_SITE_PACKAGES_SCRIPT for Python 3.10
    
    This closes #22782.
---
 .../flink/python/util/PythonEnvironmentManagerUtils.java     | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/flink-python/src/main/java/org/apache/flink/python/util/PythonEnvironmentManagerUtils.java b/flink-python/src/main/java/org/apache/flink/python/util/PythonEnvironmentManagerUtils.java
index 02f7067a724..2aecd009e6d 100644
--- a/flink-python/src/main/java/org/apache/flink/python/util/PythonEnvironmentManagerUtils.java
+++ b/flink-python/src/main/java/org/apache/flink/python/util/PythonEnvironmentManagerUtils.java
@@ -55,16 +55,8 @@ public class PythonEnvironmentManagerUtils {
 
     private static final String GET_SITE_PACKAGES_PATH_SCRIPT =
             "import sys;"
-                    + "from distutils.dist import Distribution;"
-                    + "install_obj = Distribution().get_command_obj('install', create=True);"
-                    + "install_obj.prefix = sys.argv[1];"
-                    + "install_obj.finalize_options();"
-                    + "installed_dir = [install_obj.install_purelib];"
-                    + "install_obj.install_purelib != install_obj.install_platlib and "
-                    + "installed_dir.append(install_obj.install_platlib);"
-                    + "print(installed_dir[0]);"
-                    + "len(installed_dir) > 1 and "
-                    + "print(installed_dir[1])";
+                    + "import sysconfig;"
+                    + "print(sysconfig.get_path('platlib', vars={'base': sys.argv[1], 'platbase': sys.argv[1]}))";
 
     private static final String CHECK_PIP_VERSION_SCRIPT =
             "import sys;"