Search code examples
pythonpython-docx

ModuleNotFoundError: No module named 'docxtpl'


I know that this is a simple question...I have tried going through a few of the other questions related to ModuleNotFoundError w/Pycharm and I tried uninstalling docxptl via pip but to no avail.

Looking in the library i see docxtpl so I am a bit confused.

I also uninstalled and reinstalled lxml via pip as that seemed to cause some issues with docxptl with other people with docxtpl

code:

from docxtpl import DocxTemplate

error message:

ModuleNotFoundError: No module named 'docxtpl'

Solution

  • Follow my steps carefully:

    • Go to PyCharm settings
    • Search for Python Interpreter
    • Click on the + icon in the window
    • Then search for docxtpl in the new window and then click on it
    • Then select Install Package

    Full fledged tutorial here: https://www.jetbrains.com/help/pycharm/installing-uninstalling-and-upgrading-packages.html

    enter image description here