Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-14122

Python portable precommit broken: 'get_installed_distributions'

Details

    Description

      Successfully installed PTable-0.9.2 pip-licenses-2.3.0
      WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
      Traceback (most recent call last):
      File "/usr/local/lib/python3.9/site-packages/piplicenses.py", line 40, in <module>
      from pip._internal.utils.misc import get_installed_distributions
      ImportError: cannot import name 'get_installed_distributions' from 'pip._internal.utils.misc' (/usr/local/lib/python3.9/site-packages/pip/_internal/utils/misc.py)

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
      File "/usr/local/bin/pip-licenses", line 5, in <module>
      from piplicenses import main
      File "/usr/local/lib/python3.9/site-packages/piplicenses.py", line 42, in <module>
      from pip import get_installed_distributions
      ImportError: cannot import name 'get_installed_distributions' from 'pip' (/usr/local/lib/python3.9/site-packages/pip/_init_.py)
      Traceback (most recent call last):
      File "/tmp/license_scripts/pull_licenses_py.py", line 166, in <module>
      dependencies = run_pip_licenses()
      File "/tmp/license_scripts/pull_licenses_py.py", line 49, in run_pip_licenses
      dependencies = run_bash_command(command)
      File "/tmp/license_scripts/pull_licenses_py.py", line 44, in run_bash_command
      return subprocess.check_output(command.split()).decode('utf-8')
      File "/usr/local/lib/python3.9/subprocess.py", line 424, in check_output
      return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
      File "/usr/local/lib/python3.9/subprocess.py", line 528, in run
      raise CalledProcessError(retcode, process.args,
      subprocess.CalledProcessError: Command '['pip-licenses', '--with-license-file', '--with-urls', '--from=mixed', '--ignore', 'apache-beam', '--format=json']' returned non-zero exit status 1.
      The command '/bin/sh -c if [ "$pull_licenses" = "true" ] ; then pip install 'pip-licenses<3.0.0' pyyaml tenacity && python /tmp/license_scripts/pull_licenses_py.py ; fi' returned a non-zero code: 1

      > Task :sdks:python:container:py39:docker FAILED

      https://ci-beam.apache.org/job/beam_PreCommit_Portable_Python_Cron/4748

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ibzib Kyle Weaver
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m