Nikola

raw JSON →
8.3.3 verified Sat May 09 auth: no python

A modular, fast, simple, static website and blog generator written in Python. Current version: 8.3.3 (requires Python >=3.8). It supports reStructuredText, Markdown, and other markup formats, with theming and plugin support. Release cadence is irregular, typically a few releases per year.

pip install nikola
error ModuleNotFoundError: No module named 'nikola.core'
cause Old code tries to import from 'nikola.core', which was restructured in v8.
fix
Use 'from nikola import Nikola' or 'from nikola.__main__ import main' as appropriate.
error ! [Errno 2] No such file or directory: 'nikola'
cause Nikola is not installed or not in the PATH after installation.
fix
Run 'pip install nikola' and ensure the scripts directory is in your PATH (e.g., on Windows, use 'python -m nikola' instead).
error TypeError: __init__() got an unexpected keyword argument 'template_engine'
cause In Nikola 8.x, the constructor signature changed. Passing template_engine directly is no longer supported.
fix
Set 'TEMPLATE_ENGINE' in your conf.py file instead of passing it to the constructor.
breaking In Nikola 8.x, the default template engine changed from Mako to Jinja2. Existing themes using Mako will fail unless you set TEMPLATE_ENGINE = 'mako' in conf.py.
fix Add 'TEMPLATE_ENGINE = "mako"' to your conf.py file or update your themes to Jinja2.
deprecated The 'nikola new_post' command has been deprecated in favor of 'nikola new'.
fix Use 'nikola new' instead of 'nikola new_post'.
gotcha If you run 'nikola init' without the --demo option, it creates an empty site. Many users expect a sample blog and get confused.
fix Use 'nikola init --demo mysite' to create a site with sample content.
gotcha The 'PATH' configuration variable in conf.py is a list of strings, not a single string. Common mistake: setting PATH = '/path/to/something' instead of PATH = ['/path/to/something'].
fix Ensure PATH is always a list, e.g., PATH = ['posts'].

Verify Nikola is installed and can be imported. Note that the CLI is the primary interface; programmatic usage is possible but not common.

import os
try:
    from nikola import Nikola
    from nikola.__main__ import main as nikola_main
    # Example: create a new site (non-interactively)
    # In practice, use: nikola init mysite
    print('Nikola imported successfully')
except ImportError as e:
    print('Error importing Nikola:', e)