getnikola / nikola

A static website and blog generator
https://getnikola.com/
MIT License
2.6k stars 445 forks source link

TypeError for demo build (GistExtension/PodcastExtension/Markdown) #3635

Closed ratkingsminion closed 2 years ago

ratkingsminion commented 2 years ago

Environment

Python Version: installed via MS Store, Python 3.10

Nikola Version: Can't find out, as nikola version spawns the same error as below. I just downloaded the current one today.

Operating System: Windows 10

Description:

Hallo, I followed the Getting Started guide and without changing anything I called nikola build with a demo site. I get the following error:

Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\tools\nikola\Scripts\nikola.exe\__main__.py", line 7, in <module>
  File "C:\tools\nikola\lib\site-packages\nikola\__main__.py", line 166, in main
    _ = DN.run(oargs)
  File "C:\tools\nikola\lib\site-packages\nikola\__main__.py", line 354, in run
    self.nikola.init_plugins()
  File "C:\tools\nikola\lib\site-packages\nikola\nikola.py", line 1173, in init_plugins
    plugin_info.plugin_object.set_site(self)
  File "C:\tools\nikola\lib\site-packages\nikola\plugins\compile\markdown\__init__.py", line 105, in set_site
    self.converters[lang] = ThreadLocalMarkdown(extensions, lang_extension_configs)
  File "C:\tools\nikola\lib\site-packages\nikola\plugins\compile\markdown\__init__.py", line 59, in __init__
    self.markdown = Markdown(extensions=extensions, extension_configs=extension_configs, output_format="html5")
  File "C:\tools\nikola\lib\site-packages\markdown\core.py", line 96, in __init__
    self.registerExtensions(extensions=kwargs.get('extensions', []),
  File "C:\tools\nikola\lib\site-packages\markdown\core.py", line 131, in registerExtensions
    raise TypeError(
TypeError: Extension "yapsy_loaded_plugin_mdx_gist_0.GistExtension" must be of type: "markdown.extensions.Extension"
JesperDramsch commented 2 years ago

This is also happening on my build on my website with a Podcastextension. No idea how to debug this.

danshapero commented 2 years ago

@ratkingsminion You can do pip show nikola to query pip for what nikola version you're using.

I got a similar error message on nikola-8.2.2 but with PodcastExtension instead of Gist, even when I did a command like nikola --help. I tried downgrading several packages to see if I could make the error go away; downgrading the the markdown package from 3.4.1 to 3.3 made everything work. It's not clear to me if this is a problem in nikola or yapsy and I haven't dug any deeper to see what a more permanent fix might be.

Temporary workaround: pip install markdown==3.3.

Kwpolska commented 2 years ago

master is now compatible with more recent versions of python-markdown (the code quality of those plugins isn’t the greatest though).

JesperDramsch commented 2 years ago

@Kwpolska thanks for the quick fix. Could you make this a release for the Nikola action users?

JesperDramsch commented 2 years ago

@Kwpolska following up on this as it is still breaking the automatic nikola action which is needed to run a scheduled blog on Nikola.

maphew commented 1 year ago

I got this same error with Nikola installed via conda on Windows 11. The version there (today) is 8.2.2. I attempted to upgrade to 8.2.3 in place using pip upgrade nikola[extras], and although new packages are downloaded and installed the error above still occurred and pip show nikola still reported 8.2.2.

A round of conda uninstall -y nikola && pip install nikola[extras] fixed it.

Kwpolska commented 1 year ago

@maphew The Conda package is not an official Nikola package and we do not support it. We recommend using pip for Nikola (you don’t need any fancy scientiic packages for it, even if you’re using Jupyter notebooks). Please raise this issue with whoever provides the Conda package.