Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-32034

Python's DistUtils is deprecated as of 3.10

    XMLWordPrintableJSON

Details

    • Patch

    Description

      I have recent just went through an upgrade from 1.13 to 1.17, along with that I upgraded the python version on our Flink Session server. Most everything that is part of our workflow works, except for Python Dependency Management.

      After doing some digging, I found the reason is due to the DeprecationWarning that is printed when trying to get the site packages path. The script is 

      GET_SITE_PACKAGES_PATH_SCRIPT and it is executed in the getSitePackagesPath method in the PythonEnvironmentManagerUtils class. The issue is that the DeprecationWarning is included into the PYTHONPATH environment variable which is passed to the beam runner. The deprecation warning breaks Python's ability to find the site packages due to characters that are not allowed in filesystem paths.

       

      Example of the PYTHONPATH environment variable:
      PYTHONPATH == <string>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives:/tmp/python-dist-c63e1464-925c-4289-bb71-c6f50e83186f/python-requirements/lib/python3.10/site-packages
      HADOOP_CONF_DIR == /opt/flink/conf

      Attachments

        1. get_site_packages_path_script_shortened.py
          0.1 kB
          Colten Pilgreen
        2. get_site_packages_path_script.py
          0.2 kB
          Colten Pilgreen

        Issue Links

          Activity

            People

              coltenp Colten Pilgreen
              coltenp Colten Pilgreen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: