Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] 71.0.0 fails with 'importlib_metadata' has no attribute 'EntryPoints' on Python 3.8 #4478

Closed
bmcalary-atlassian opened this issue Jul 18, 2024 · 2 comments

Comments

@bmcalary-atlassian
Copy link

bmcalary-atlassian commented Jul 18, 2024

setuptools version

71.0.0

Python version

3.8

OS

Ubuntu 20.04

Additional environment information

No response

Description

This started a few hours ago when our pipeline picked up 71.0.0, works fine on 70.3.0.

python3 -m pip install --upgrade --no-cache-dir --no-color --no-input --upgrade pip packaging setuptools python-debian
Requirement already satisfied: pip in /usr/local/lib/python3.8/dist-packages (24.1.2)
Requirement already satisfied: packaging in /usr/local/lib/python3.8/dist-packages (24.1)
Requirement already satisfied: setuptools in /usr/local/lib/python3.8/dist-packages (71.0.0)

python3 -m pip install --no-cache-dir --no-color --no-input https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-py3-latest.tar.gz --upgrade
Collecting https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-py3-latest.tar.gz
  Downloading https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-py3-latest.tar.gz (549 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 549.6/549.6 kB 690.9 kB/s eta 0:00:00
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [10 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 14, in <module>
        File "/usr/local/lib/python3.8/dist-packages/setuptools/__init__.py", line 19, in <module>
          from .dist import Distribution
        File "/usr/local/lib/python3.8/dist-packages/setuptools/dist.py", line 30, in <module>
          from . import _entry_points
        File "/usr/local/lib/python3.8/dist-packages/setuptools/_entry_points.py", line 44, in <module>
          def validate(eps: metadata.EntryPoints):
      AttributeError: module 'importlib_metadata' has no attribute 'EntryPoints'
      [end of output]

Expected behavior

No error

How to Reproduce

See Description

Output

See Description

@bmcalary-atlassian bmcalary-atlassian added bug Needs Triage Issues that need to be evaluated for severity and status. labels Jul 18, 2024
@jaraco
Copy link
Member

jaraco commented Jul 18, 2024

This behavior is by design. Setuptools now will prefer installed packages over its vendored ones, but it can't yet declare them. That means that if you have an installed dependency but it's older than the one setuptools needs, it will not work.

The workaround/fix is to install these dependencies when installing setuptools. You may be tempted to install setuptools[core], but please don't as that's unsupported and will likely break in the future.

Either that, or ensure that there aren't older versions of those dependencies installed.

Eventually, we plan to have setuptools declare (and thus install) its own dependencies so you don't have to do that, but for Setuptools to do that, we first have to solve pypa/packaging-problems#342 (an ongoing effort).

@jaraco jaraco removed bug Needs Triage Issues that need to be evaluated for severity and status. labels Jul 18, 2024
@bmcalary-atlassian
Copy link
Author

bmcalary-atlassian commented Jul 18, 2024

Thanks, importing those, specifically importlib_metadata fixed the problem. Shame its not automatic at the moment.

Thanks for the quick response. Much appreciated.

@jaraco jaraco pinned this issue Jul 18, 2024
nicofrand added a commit to nicofrand/kresus_ynh that referenced this issue Jul 19, 2024
nicofrand added a commit to YunoHost-Apps/kresus_ynh that referenced this issue Jul 19, 2024
odl-github pushed a commit to opendaylight/integration-test that referenced this issue Aug 27, 2024
setuptools dependency requirements may not be satisfied with the
installed packages, which are now preferred over the vendored ones with
71.0.0:

pypa/setuptools#4478

Make sure that the dependencies are also upgraded when setuptools are
upgraded.

And install the packages into the user directory instead of running it
as the 'root' user, which is not recommended.

Change-Id: I12be08c1442f3dd948638a502fc37ff2877bc966
Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants