Module not found error but it's installed

In my frappe application I am using the python-docx library. I added this library to the application’s pyproject.toml and installed the library in the virtual environment. I can import a module in the console, started with “bench console”, but when I run the module with “bench execute” I encounter an error " from docxtpl import DocxTemplate
ModuleNotFoundError: No module named ‘docxtpl’"
How to fix it?