getpelican / pelican

Static site generator that supports Markdown and reST syntax. Powered by Python.

Home Page:https://getpelican.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pelican 4.9.1. cannot start

mpaglia0 opened this issue · comments

  • I have read the Filing Issues and subsequent “How to Get Help” sections of the documentation.
  • I have searched the issues (including closed ones) and believe that this is not a duplicate.
  • OS version and name: Suse Tumbleweed
  • Python version: 3.11.5
  • Pelican version: 4.9.1
  • Link to theme:
  • Links to plugins:
  • Link to your site:
  • Link to your source:
  • Link to a Gist with the contents of your settings file:

Issue

Updated to Pelican 4.9.1 right now but command ends in the following error:
CRITICAL AttributeError: module 'jinja2.ext' has no attribute 'with_'

If I downgrade Jinja2 to 3.0 all works.

Please post detailed traceback from running pelican with --debug: pelican --debug content ...

pelican --debug content output:

          CRITICAL AttributeError: module 'jinja2.ext' has no attribute 'with_'                                                                                                                       __init__.py:666
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/mau/Sistema/pelican/lib64/python3.11/site-packages/pelican/__init__.py:662 in main         │
│                                                                                                  │
│   659 │   │   │   )                                                                              │
│   660 │   │   else:                                                                              │
│   661 │   │   │   with console.status("Generating..."):                                          │
│ ❱ 662 │   │   │   │   pelican.run()                                                              │
│   663 │   except KeyboardInterrupt:                                                              │
│   664 │   │   logger.warning("Keyboard interrupt received. Exiting.")                            │
│   665 │   except Exception as e:                                                                 │
│                                                                                                  │
│ /home/mau/Sistema/pelican/lib64/python3.11/site-packages/pelican/__init__.py:99 in run           │
│                                                                                                  │
│    96 │   │   context["static_content"] = {}                                                     │
│    97 │   │   context["localsiteurl"] = self.settings["SITEURL"]                                 │
│    98 │   │                                                                                      │
│ ❱  99 │   │   generators = [                                                                     │
│   100 │   │   │   cls(                                                                           │
│   101 │   │   │   │   context=context,                                                           │
│   102 │   │   │   │   settings=self.settings,                                                    │
│                                                                                                  │
│ /home/mau/Sistema/pelican/lib64/python3.11/site-packages/pelican/__init__.py:100 in <listcomp>   │
│                                                                                                  │
│    97 │   │   context["localsiteurl"] = self.settings["SITEURL"]                                 │
│    98 │   │                                                                                      │
│    99 │   │   generators = [                                                                     │
│ ❱ 100 │   │   │   cls(                                                                           │
│   101 │   │   │   │   context=context,                                                           │
│   102 │   │   │   │   settings=self.settings,                                                    │
│   103 │   │   │   │   path=self.path,                                                            │
│                                                                                                  │
│ /home/mau/Sistema/pelican/lib64/python3.11/site-packages/pelican/generators.py:329 in __init__   │
│                                                                                                  │
│    326 │   │   self.categories = defaultdict(list)                                               │
│    327 │   │   self.related_posts = []                                                           │
│    328 │   │   self.authors = defaultdict(list)                                                  │
│ ❱  329 │   │   super().__init__(*args, **kwargs)                                                 │
│    330 │   │   signals.article_generator_init.send(self)                                         │
│    331 │                                                                                         │
│    332 │   def generate_feeds(self, writer):                                                     │
│                                                                                                  │
│ /home/mau/Sistema/pelican/lib64/python3.11/site-packages/pelican/generators.py:264 in __init__   │
│                                                                                                  │
│    261 │   │   note the multiple inheritance structure                                           │
│    262 │   │   """                                                                               │
│    263 │   │   cls_name = self.__class__.__name__                                                │
│ ❱  264 │   │   Generator.__init__(                                                               │
│    265 │   │   │   self, *args, readers_cache_name=(cls_name + "-Readers"), **kwargs             │
│    266 │   │   )                                                                                 │
│    267                                                                                           │
│                                                                                                  │
│ /home/mau/Sistema/pelican/lib64/python3.11/site-packages/pelican/generators.py:78 in __init__    │
│                                                                                                  │
│     75 │   │   │   os.path.join(simple_theme_path, "themes", "simple", "templates")              │
│     76 │   │   )                                                                                 │
│     77 │   │                                                                                     │
│ ❱   78 │   │   self.env = Environment(                                                           │
│     79 │   │   │   loader=ChoiceLoader(                                                          │
│     80 │   │   │   │   [                                                                         │
│     81 │   │   │   │   │   FileSystemLoader(self._templates_path),                               │
│                                                                                                  │
│ /home/mau/Sistema/pelican/lib64/python3.11/site-packages/jinja2/environment.py:363 in __init__   │
│                                                                                                  │
│    360 │   │   self.policies = DEFAULT_POLICIES.copy()                                           │
│    361 │   │                                                                                     │
│    362 │   │   # load extensions                                                                 │
│ ❱  363 │   │   self.extensions = load_extensions(self, extensions)                               │
│    364 │   │                                                                                     │
│    365 │   │   self.is_async = enable_async                                                      │
│    366 │   │   _environment_config_check(self)                                                   │
│                                                                                                  │
│ /home/mau/Sistema/pelican/lib64/python3.11/site-packages/jinja2/environment.py:117 in            │
│ load_extensions                                                                                  │
│                                                                                                  │
│    114 │                                                                                         │
│    115 │   for extension in extensions:                                                          │
│    116 │   │   if isinstance(extension, str):                                                    │
│ ❱  117 │   │   │   extension = t.cast(t.Type["Extension"], import_string(extension))             │
│    118 │   │                                                                                     │
│    119 │   │   result[extension.identifier] = extension(environment)                             │
│    120                                                                                           │
│                                                                                                  │
│ /home/mau/Sistema/pelican/lib64/python3.11/site-packages/jinja2/utils.py:149 in import_string    │
│                                                                                                  │
│   146 │   │   │   module, _, obj = import_name.rpartition(".")                                   │
│   147 │   │   else:                                                                              │
│   148 │   │   │   return __import__(import_name)                                                 │
│ ❱ 149 │   │   return getattr(__import__(module, None, None, [obj]), obj)                         │
│   150 │   except (ImportError, AttributeError):                                                  │
│   151 │   │   if not silent:                                                                     │
│   152 │   │   │   raise                                                                          │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: module 'jinja2.ext' has no attribute 'with_'

This is coming from plugins or your config. If it exists, check JINJA_ENVIRONMENT defined in your settings.