## TL;DR
The jinja template loader cannot find the template nbconvert asked for, which means the template name is misspelled, the nbconvert version does not ship that template, or a custom `--template-path` points nowhere. List available templates with `jupyter nbconvert --to html --template=[name]` variants or check the docs for your version, use `--template lab` or `classic` explicitly, and verify the named template exists before scripting the export.

```text
nbconvert to html failed with 'template not found' jinja error
```

## Use this when
- HTML export fails with jinja2 TemplateNotFound.
- You passed a custom `--template` name.
- nbconvert was recently upgraded or downgraded.

## Not for this skill when
- HTML exports but looks broken. That is a template content issue.
- The failure is a LaTeX error. That is the PDF path.

## Steps
1. Confirm the nbconvert version: `jupyter nbconvert --version`. Verify: you know which templates it ships.
2. Try the stock templates explicitly: `--template lab` then `--template classic`. Verify: one of them works, proving the loader is fine.
3. If you need a custom template, check the path: `--template-path` must contain a directory with the template files. Verify: the files exist at that path.
4. Fix the template name spelling against the actual directory name. Verify: the name matches exactly, case included.
5. Re-run the export. Verify: the HTML file is written without jinja errors.

## Variant phrasings
### nbconvert template not found
Short form. Name or path is wrong.

### jinja template not found nbconvert html
Library phrasing. Check the template loader inputs.

### nbconvert html export template error
General phrasing. Try stock templates first.

Compatibility: nbconvert 6/7. Template names changed across versions (e.g. `basic` to `lab`); check your version's docs.

## Why it happens
nbconvert 6+ reorganized its template system around named template directories, and names that existed in nbconvert 5 (or in blog posts) do not exist in 6/7. Jinja's loader then raises TemplateNotFound, which nbconvert passes through with little context. Custom template paths add the second failure mode: a relative path that resolves differently when the export runs from another directory.

## Edge cases / pitfalls
- Copying a `--template` invocation from an old tutorial is the most common trigger. Check the name against your installed version.
- Template directories need specific files (conf.json, index.html.j2). A half-copied custom template fails the same way.
- User-level template dirs (`share/jupyter/nbconvert/templates`) can shadow stock names. Check for shadowing if stock names fail.
- The error message names the missing template; read it literally instead of guessing.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_OqxhutVEPo-8ZcZ1R9_AXA
