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

AttributeError: 'EntryPoints' object has no attribute 'get' #3009

Closed
aparnakcvs opened this issue Oct 17, 2022 · 1 comment
Closed

AttributeError: 'EntryPoints' object has no attribute 'get' #3009

aparnakcvs opened this issue Oct 17, 2022 · 1 comment

Comments

@aparnakcvs
Copy link

aparnakcvs commented Oct 17, 2022

# mkdocs build
Traceback (most recent call last):
  File "/usr/local/bin/mkdocs", line 10, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/mkdocs/__main__.py", line 244, in build_command
    from mkdocs.commands import build
  File "/usr/local/lib/python3.7/dist-packages/mkdocs/commands/build.py", line 15, in <module>
    from mkdocs.config.defaults import MkDocsConfig
  File "/usr/local/lib/python3.7/dist-packages/mkdocs/config/defaults.py", line 4, in <module>
    from mkdocs.config import config_options as c
  File "/usr/local/lib/python3.7/dist-packages/mkdocs/config/config_options.py", line 30, in <module>
    import markdown
  File "/usr/local/lib/python3.7/dist-packages/markdown/__init__.py", line 29, in <module>
    from .core import Markdown, markdown, markdownFromFile  # noqa: E402
  File "/usr/local/lib/python3.7/dist-packages/markdown/core.py", line 26, in <module>
    from . import util
  File "/usr/local/lib/python3.7/dist-packages/markdown/util.py", line 85, in <module>
    INSTALLED_EXTENSIONS = metadata.entry_points().get('markdown.extensions', ())
AttributeError: 'EntryPoints' object has no attribute 'get'
@oprypin
Copy link
Contributor

oprypin commented Oct 17, 2022

You're reporting an error from Python-Markdown 3.2.2, released May 8, 2020
Based on matching against the stack trace line
https://github.com/Python-Markdown/markdown/blob/3.2.2/markdown/util.py#L85

This error happens only on Python 3.7 (superseded by Python 3.8 on Oct 14, 2019)
https://github.com/Python-Markdown/markdown/blob/7df1ed30d98cdc1316ec8da150644d957f1c6303/markdown/util.py#L32-L34
because the library importlib_metadata==5 (released Oct 2, 2022) had an intentional breakage (yet another totally incompetent move from their maintenance team, I have to say).

This was fixed in Python-Markdown 3.3.5, released Nov 16, 2021
https://github.com/Python-Markdown/markdown/blob/3.3.5/markdown/util.py#L88

So, you have any of the following options:

  • pip install 'Python-Markdown>=3.3.5'
  • Python >= 3.8
  • pip install 'importlib_metadata<5'

I'm not sure how you managed to get the very latest importlib_metadata with all other packages remaining ancient. Generally just upgrade your dependencies, please.

@oprypin oprypin closed this as completed Oct 17, 2022
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