I built a streamlit app and am trying to dockerise it. In my streamlit app, I import the docx2pdf python library. I built the docker image and tried to open the app on my local host. However, I am facing the above error.

Also, I am using Docker Desktop and built the image with docker on my command prompt terminal (Windows).

1

There are 1 best solutions below

0
aneroid On

The error message tells you everything you need to know. So does the docx2pdf pypi page:

Convert docx to pdf on Windows or macOS directly using Microsoft Word (must be installed).

MS Word needs to be installed for this library to work. And if you are containerising it, then the container needs to have MS Word installed, or the associated libraries which docx2pdf uses. So you need to use Windows containers, and not Linux containers - Docker Desktop allows both on Windows. As well as installing whatever OS-environment is needed for MS Word to run.

Alternatively, use a library which doesn't require MS Word. This isn't the site for library recommendations.