Can PyMUPDF works with chaquopy in Android Studio? #4253
Replies: 1 comment
-
PyMuPDF is not a pure Python package, it uses the powerful PDF C library MuPDF, with additional C++ and Python code auto-generated using the libclang parser and SWIG, which is used by the top-level hand-written Python and C++ code that provides the PyMuPDF API. The resulting wheel/installation has various dynamic libraries and Python code that are all carefully arranged to work together at runtime. There is absolutely not point in trying to write your own setup.py. PyMuPDF already comes with a I'm afraid that i don't know whether it is practical to get PyMuPDF's setup.py to work on Android. It would require, amongst other things, that Android supports compiling+linking of MuPDF, has Python packages libclang and swig, and has a C++ compiler equivalent to g++ or clang++. I hope that all makes sense. |
Beta Was this translation helpful? Give feedback.
-
Hi everyone,
I’m currently trying to integrate Python into an Android project using Chaquopy in Android Studio (version: Ladybug). While most Python libraries and code supported by Chaquopy work seamlessly, I’ve been running into issues when trying to integrate PyMuPDF.
Specifically, when I attempt to build my project with PyMuPDF, it fails with an error. To resolve this, I tried creating a .whl (wheel) file for PyMuPDF to integrate with the Android app, but I still encountered errors during the build process.
Here is the
setup.py file
I used to create the wheel:In Build Gradle app
**when try to install package directly using install ("PyMuPDF") **
Failed to install PyMuPDF from https://files.pythonhosted.org/packages/40/fc/dd8776dc5c2f8cf0e51cf81a5f1de3840996bed7ca03ec768b0733024fb9/pymupdf-1.25.2.tar.gz#sha256=9ea88ff1b3ccb359620f106a6fd5ba6877d959d21d78272052c3496ceede6eec.
And same case when using Whl file install ("pdf-0.1.0-py3-none-any.whl")
Failed to install PyMuPDF from https://files.pythonhosted.org/packages/40/fc/dd8776dc5c2f8cf0e51cf81a5f1de3840996bed7ca03ec768b0733024fb9/pymupdf-1.25.2.tar.gz#sha256=9ea88ff1b3ccb359620f106a6fd5ba6877d959d21d78272052c3496ceede6eec (from pdf==0.1.0).
Questions:
Any insights or guidance would be greatly appreciated! Thank you in advance for your help.
Beta Was this translation helpful? Give feedback.
All reactions