MadLittleMods / markdown-icons

Easily display icon fonts in markdown.
Other
13 stars 12 forks source link

Cannot load with Python version 3.8.10 #14

Open vaonet-jks opened 2 years ago

vaonet-jks commented 2 years ago

Most important, I am not a python developer. I use mkdocs to produce documentation.

The error I get is:

vaonet@chat-vaonet-com:~/internal-docs-server/site/admin-help$ mkdocs serve --dev-addr 192.168.1.111:3333
INFO     -  Building documentation...
ERROR    -  Config value: 'markdown_extensions'. Error: Failed loading extension "iconfonts".
Aborted with 1 Configuration Errors!
vaonet@chat-vaonet-com:~/internal-docs-server/site$ python3 -m markdown --noisy -x iconfonts
/usr/lib/python3/dist-packages/apport/report.py:13: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import fnmatch, glob, traceback, errno, sys, atexit, locale, imp, stat

Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/vaonet/.local/lib/python3.8/site-packages/markdown/__main__.py", line 151, in <module>
    run()
  File "/home/vaonet/.local/lib/python3.8/site-packages/markdown/__main__.py", line 145, in run
    markdown.markdownFromFile(**options)
  File "/home/vaonet/.local/lib/python3.8/site-packages/markdown/core.py", line 404, in markdownFromFile
    md = Markdown(**kwargs)
  File "/home/vaonet/.local/lib/python3.8/site-packages/markdown/core.py", line 96, in __init__
    self.registerExtensions(extensions=kwargs.get('extensions', []),
  File "/home/vaonet/.local/lib/python3.8/site-packages/markdown/core.py", line 123, in registerExtensions
    ext = self.build_extension(ext, configs.get(ext, {}))
  File "/home/vaonet/.local/lib/python3.8/site-packages/markdown/core.py", line 162, in build_extension
    module = importlib.import_module(ext_name)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'iconfonts'

I have another machine that is running Python 3.6.9 and it works there with dep warnings.

administrator@extDocsSvr:~/.local/lib/python3.6/site-packages/markdown/extensions$ python3 -m markdown --noisy -x iconfonts
Successfully imported extension module "iconfonts".
/home/administrator/.local/lib/python3.6/site-packages/markdown/extensions/iconfonts.py:148: DeprecationWarning: Using the add method to register a processor or pattern is deprecated. Use the `register` method instead.
  md.inlinePatterns.add(name, pattern, "<reference")

/home/administrator/.local/lib/python3.6/site-packages/markdown/core.py:125: DeprecationWarning: The 'md_globals' parameter of 'iconfonts.IconFontsExtension.extendMarkdown' is deprecated.
  ext._extendMarkdown(self)

Successfully loaded extension "iconfonts.IconFontsExtension".

Any suggestions other than reverting to 3.6.9?

Kevin

MadLittleMods commented 2 years ago

@vaonet-jks This project hasn't seen any love to ensure compatibility for new Python versions. Any existing compatibility is just a happy coincidence.

vaonet-jks commented 2 years ago

Anything I can do to entice a fix?

MadLittleMods commented 2 years ago

@vaonet-jks I'm not interested in making a fix but feel free to submit a pull request.