Installing¶
or, with uv:
Python 3.9 through 3.14. Installing pulls in python-docx-ng for the document model and Jinja2 for the templating.
Replacing docxtpl¶
The distribution is docxtpl-ng; the package it installs is docxtpl. That
is deliberate — import docxtpl keeps working, so swapping the dependency is
the whole migration and no source file has to change.
The two therefore cannot be installed into the same environment: they claim the same import name, and whichever was installed last wins. Uninstall the original first.
The same applies one level down
docxtpl-ng depends on python-docx-ng, which installs into the same
docx/ package as python-docx, for the same reason. Removing docxtpl
normally removes python-docx with it; if it does not, remove that too.
If you need to run both — to compare their output while migrating, say — put them in separate environments and compare the documents they produce, which is how this project's own parity tests do it.