Registry / web-framework / nikola

nikola

JSON →
library8.3.3pypypi✓ verified 83d ago

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
INSTALL
IMPORT
SIG · NIKOLA
N
nikola
web-frameworkpythonv8.3.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

main
from nikola.__main__ import main
from nikola import main
Nikola's CLI entry point is in __main__; importing from nikola.misc may fail.
Nikola
from nikola import Nikola
from nikola.core import Nikola
In older versions, the main class was in nikola.core, but since v8 it's directly in nikola.

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)
nikola --version
Debug
Known issues
breakingIn 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.
affects: >=8.0.0
deprecatedThe 'nikola new_post' command has been deprecated in favor of 'nikola new'.
fix
Use 'nikola new' instead of 'nikola new_post'.
affects: >=8.2.0
gotchaIf 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.
affects: all
gotchaThe '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'].
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'nikola.core'
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.
! [Errno 2] No such file or directory: 'nikola'
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).
TypeError: __init__() got an unexpected keyword argument 'template_engine'
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.
Upgrade
Version history
8.3.3latest on PyPI · released May 17, 2025
Audit
Dependencies
PygmentsoptionalSyntax highlighting for code blocks.
markdownoptionalMarkdown input format support.
docutilsoptionalreStructuredText input format support.
Agent activity
6 hits · last 30 days
node
6
Resources
nikola — pip install nikola · libregistry