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] Installation error importlib_metadata has no attribute 'EntryPoints #4570

Closed
pozos1096 opened this issue Aug 15, 2024 · 3 comments · May be fixed by #4572
Closed

[BUG] Installation error importlib_metadata has no attribute 'EntryPoints #4570

pozos1096 opened this issue Aug 15, 2024 · 3 comments · May be fixed by #4572

Comments

@pozos1096
Copy link

setuptools version

71.0.0

Python version

Python version: 3.8.10

OS

Linux

Additional environment information

  • Fossology version: 4.4.0
  • Python version: 3.8.10
  • importlib_metadata version: 1.5.0
  • setuptools version: 71.0.0

Description

Hi everyone,
I'm having trouble running the post-installation script for Fossology as outlined in the installation guide.

Expected behavior

Installation finished correctly.

How to Reproduce

When I execute the script with the following command:

sudo /usr/local/lib/fossology/fo-postinstall


### Output

```console
ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-paao6nic/progress/setup.py'"'"'; __file__='"'"'/tmp/pip-install-paao6nic/progress/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-paao6nic/progress/pip-egg-info
cwd: /tmp/pip-install-paao6nic/progress/
Complete output (9 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/home/fossy/pythondeps/setuptools/__init__.py", line 21, in <module>
        from .dist import Distribution
      File "/home/fossy/pythondeps/setuptools/dist.py", line 29, in <module>
        from . import _entry_points
      File "/home/fossy/pythondeps/setuptools/_entry_points.py", line 44, in <module>
        def validate(eps: metadata.EntryPoints):
    AttributeError: module 'importlib_metadata' has no attribute 'EntryPoints'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
@pozos1096 pozos1096 added bug Needs Triage Issues that need to be evaluated for severity and status. labels Aug 15, 2024
@abravalheri
Copy link
Contributor

abravalheri commented Aug 15, 2024

Hi @pozos1096, quick question: I don't know if it is possible for you to check in your setup, but if we add the from __future__ import annotations statement at the top of the setuptools/_entry_points.py file, would that solve the problem?

If that solves the problem, we can create a PR with that change.

Otherwise, if that is not enough, it would seem to me that the version of importlib_metadata that you have installed is too old, and it would be necessary to update it (probably to 4.6 or more recent).

/cc @jaraco might have better information about that.

@jaraco
Copy link
Member

jaraco commented Aug 15, 2024

importlib_metadata >= 6 is what's stipulated in the setuptools[core] dependencies, so that's what's needed. If that can't be installed, is it possible to uninstall the version of importlib_metadata you have installed (such that setuptools will fall back to the vendored version)?

This issue was (somewhat intentionally) introduced in the 71 release where setuptools starts using libraries in the environment instead of bundling its own, which has pushed the onus on users and system integrators to make sure that the installed versions of the dependencies are compatible.

I wonder if Setuptools should simply fail fast whenever its core dependencies are not satisfied.

@jaraco jaraco added downstream and removed bug Needs Triage Issues that need to be evaluated for severity and status. labels Aug 15, 2024
@pozos1096
Copy link
Author

Thank you for your feedback @jaraco. After updating this dependencies (as indicated in the link below) I was able to succesfully installed the tool: #4478 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants