fralau / mkdocs-macros-plugin

Create richer and more beautiful pages in MkDocs, by using variables and calls to macros in the markdown code.
https://mkdocs-macros-plugin.readthedocs.io
Other
318 stars 50 forks source link

ModuleNotFoundError: No module named 'pkg_resources' on python 3.12 #169

Closed dunossauro closed 1 year ago

dunossauro commented 1 year ago

On python 3.12 beta we can't install mkdocs-macro, pkg_resources does not exist

 File "/.../.venv/lib/python3.12/site-packages/mkdocs_macros/__init__.py", line 7, in <module>
    from .context import fix_url, is_relative as is_relative_url
  File "/.../.venv/lib/python3.12/site-packages/mkdocs_macros/context.py", line 19, in <module>
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'

Related to #157

github-actions[bot] commented 1 year ago

Welcome to this project and thank you!' first issue

fralau commented 1 year ago

This is apparently not an mkdocs-macros issue, but due to a broken setuptools install: https://stackoverflow.com/questions/7446187/no-module-named-pkg-resources

Let me know if fixing setuptools fixed the issue for you?

fralau commented 1 year ago

Is this problem still open?

calebAtIspot commented 3 months ago

@fralau this is a mkdocs-macros issue. pkg_resources has been deprecated and should no longer be used.

https://setuptools.pypa.io/en/latest/pkg_resources.html

Use of pkg_resources is deprecated in favor of importlib.resources, importlib.metadata and their backports (importlib_resources, importlib_metadata). Some useful APIs are also provided by packaging (e.g. requirements and version parsing). Users should refrain from new usage of pkg_resources and should work to port to importlib-based solutions.

Relevant: https://github.com/mu-editor/mu/issues/2485