Python dependency managment issue withPyMuPDF
I'm tyring to use PyMuPDF to do some PDF operations, I get the following error
I've also tried adding the exact requirements
PyMuPDF==1.24.4
PyMuPDFb==1.24.3
No change to the error message.
6 Replies
it requires a native library libmupdf
you will need to pre-install it on your workers using init scripts
If your project doesn't require anything too fancy, I'd go with a Pure Python PDF lib, such as https://pypi.org/project/pypdf/
PyPI
pypdf
A pure-python PDF library capable of splitting, merging, cropping, and transforming PDF files
Thanks for the quick reply.
I'll take a look at pypdf first.
Unfortunately
pypdf
doesn't do the job, some files have widgets that are not parsed.
@rubenf about the pre-installing it, right now i'm using the community edition, just to get to know Windmill. I see the UI option of init scripts is for EE version only. From the documents I understand the for community edition the approach is to add the dependency via the docker file, is this correct?
Assuming it is, do I need to mention anything in the script itself so it won't try to fetch the dependency ? I'm basically asking how the package that was installed is "connected" to the script.
Thanksyou do not need to install the pip package before hand, just the native library
In your
docker-compose.yml
you should add an env var like this - INIT_SCRIPT="apt-get install NATIVELIB"
You can also point it to a script file. INIT_SCRIPT="bash /usr/src/app/scripts/startup.sh" and then have docker mount a shared folder with your startup.sh