New install is failing immediately with "ModuleNotFoundError: No module named 'imp'"

23 views
Skip to first unread message

Pito Salas

unread,
Dec 30, 2023, 11:08:52 AM12/30/23
to nikola-discuss
I must have something messed up. I am not using env. I simply installed with pip. No "extras".  Here's the trace:

~/mydev/wpconvert python --version
Python 3.12.0
~/mydev/wpconvert which python
/Users/pitosalas/.pyenv/shims/python
~/mydev/wpconvert whichh nikola
zsh: command not found: whichh
~/mydev/wpconvert which nikola
/Users/pitosalas/.pyenv/shims/nikola
~/mydev/wpconvert nikola --version
Traceback (most recent call last):
  File "/Users/pitosalas/.pyenv/versions/3.12.0/lib/python3.12/site-packages/yapsy/PluginManager.py", line 132, in <module>
    import importlib.abc.Loader as imp
ModuleNotFoundError: No module named 'importlib.abc.Loader'; 'importlib.abc' is not a package

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/pitosalas/.pyenv/versions/3.12.0/bin/nikola", line 5, in <module>
    from nikola.__main__ import main
  File "/Users/pitosalas/.pyenv/versions/3.12.0/lib/python3.12/site-packages/nikola/__init__.py", line 39, in <module>
    from .nikola import Nikola  # NOQA
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/pitosalas/.pyenv/versions/3.12.0/lib/python3.12/site-packages/nikola/nikola.py", line 49, in <module>
    from yapsy.PluginManager import PluginManager
  File "/Users/pitosalas/.pyenv/versions/3.12.0/lib/python3.12/site-packages/yapsy/PluginManager.py", line 134, in <module>
    import imp
ModuleNotFoundError: No module named 'imp'

Chris Warrick

unread,
Dec 30, 2023, 11:12:59 AM12/30/23
to nikola-...@googlegroups.com
Hi,

the plugin system Nikola is using (yapsy) is not compatible with
Python 3.12. You can try installing Yapsy from GitHub, it might yield
better results: https://github.com/tibonihoo/yapsy/issues/16

--
Chris Warrick <https://chriswarrick.com/>
PGP: 5EAAEA16

Pito Salas

unread,
Dec 30, 2023, 11:14:28 AM12/30/23
to nikola-discuss
Thanks. What;'s the latest python that would work?

Pito Salas

unread,
Dec 30, 2023, 11:20:44 AM12/30/23
to nikola-discuss
Actually... I found yapsy 2.0.0 on GitHub per your pointer. Thanks. But Nikola still not happy (see below.)

As I am choosing a static site generator for my blog, I think these issues disqualify Nikola for me. Can you suggest a reasonable substitute?

Thanks!

~/mydev/deleteme nikola --version

Traceback (most recent call last):
  File "/Users/pitosalas/.pyenv/versions/3.12.0/bin/nikola", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/pitosalas/.pyenv/versions/3.12.0/lib/python3.12/site-packages/nikola/__main__.py", line 166, in main
    _ = DN.run(oargs)
        ^^^^^^^^^^^^^
  File "/Users/pitosalas/.pyenv/versions/3.12.0/lib/python3.12/site-packages/nikola/__main__.py", line 354, in run
    self.nikola.init_plugins()
  File "/Users/pitosalas/.pyenv/versions/3.12.0/lib/python3.12/site-packages/nikola/nikola.py", line 1107, in init_plugins
    self._activate_plugins_of_category("PostScanner")
  File "/Users/pitosalas/.pyenv/versions/3.12.0/lib/python3.12/site-packages/nikola/nikola.py", line 1338, in _activate_plugins_of_category
    plugin_info.plugin_object.set_site(self)
  File "/Users/pitosalas/.pyenv/versions/3.12.0/lib/python3.12/site-packages/nikola/plugin_categories.py", line 70, in set_site
    self.inject_templates()
  File "/Users/pitosalas/.pyenv/versions/3.12.0/lib/python3.12/site-packages/nikola/plugin_categories.py", line 79, in inject_templates
    mod_path = sys.modules[self.__class__.__module__].__file__
               ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'scan_posts'
~/mydev/deleteme 

Chris Warrick

unread,
Dec 30, 2023, 11:22:41 AM12/30/23
to nikola-...@googlegroups.com
> --
> You received this message because you are subscribed to the Google Groups "nikola-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to nikola-discus...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/nikola-discuss/d2e1752f-a9da-49a8-bbbf-243a485a76ban%40googlegroups.com.

We cannot suggest substitutes.
We welcome contributions to make it work with Python 3.12. Python,
unfortunately, removes things it considers "old" at random, and Yapsy
hasn’t seen new releases in a while.

Pito Salas

unread,
Dec 30, 2023, 11:25:26 AM12/30/23
to nikola-discuss
Thanks for your rapid response!
Reply all
Reply to author
Forward
0 new messages