Skip to content
Latchkey

Nikola "conf.py" error on build in CI

Nikola imports conf.py as a Python module at the start of every command. An import that fails (a missing optional dependency) or an invalid setting raises before any rendering, ending nikola build.

What this error means

nikola build fails reading conf.py with a Python traceback - a ModuleNotFoundError for an optional package, or an error about an unexpected setting value.

nikola
Traceback (most recent call last):
  File "conf.py", line 12, in <module>
    import webassets
ModuleNotFoundError: No module named 'webassets'

Common causes

conf.py imports an uninstalled optional dependency

A feature enabled in conf.py needs an extra package (webassets, a markup compiler) that the CI environment did not install.

An invalid or removed setting

A setting whose value or name changed between Nikola versions raises when conf.py is imported.

How to fix it

Install the optional dependency

  1. Read the traceback for the missing module or bad setting.
  2. Add the package to requirements, or use the Nikola extras that include it.
  3. Re-run nikola build.
Terminal
pip install "Nikola[extras]"
nikola build

Correct the setting for your Nikola version

Update or remove a renamed setting so conf.py imports cleanly.

conf.py
# match settings to the installed Nikola version
COMPILERS = {"rest": ['.rst'], "markdown": ['.md']}

How to prevent it

  • Install Nikola with the extras your conf.py needs.
  • Keep conf.py settings aligned with the installed version.
  • Pin Nikola and its extras in requirements.

Frequently asked questions

What causes ""conf.py" error (Nikola)"?
A feature enabled in conf.py needs an extra package (webassets, a markup compiler) that the CI environment did not install.
How do I fix "conf.py" error (Nikola)?
Install the optional dependency

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card