Closed AxellLim00 closed 4 years ago
The provided wheels are for x64 architectures only (if not MS Windows). So you must compile PyMuPDF from sources. Needless to mention that MuPDF must also have been generated with this bitness. Other than that, there is no reason why it shouldn't work - there is no restriction inside PyMuPDF as per the Python bitness, and it does run on MS WIndows 32bit.
Thank you for responding and answering my question. From what I understand, it's that there are no .so files for the ARM architectures, since the wheels built for it are for x64 architectures only?
since the wheels built for it are for x64 architectures only?
The wheels I am preparing are for Windows 32bit / 64bit, Mac OSX 64bit and Linux 64bit. For Windows, I am using my own machine, for OSX and Linux, I am using the Travis CI services.
I am getting the same problem, can I use PyMuPDF in android app developed with Kivy nowadays?
Not fully related, but this might help someone. You might want to check out pdfplumber
and/or PyPDF2
packages. I originally wanted to use PyMuPDF
for converting PDF to PNG in my Android app and stumbled upon the same issue. Then realized this could also be done with pdfplumber
which is a pure python package. My guess would be the packages share a great deal of features. Also quoting from their github page :
pymupdf is substantially faster than pdfminer.six (and thus also pdfplumber) and can generate and modify PDFs, but the library requires installation of non-Python software (MuPDF). It also does not enable easy access to shape objects (rectangles, lines, etc.), and does not provide table-extraction or visual debugging tools.
Well the comments in pdfplumber are not (no longer) correct:
So remains the question whether there are wheels installable on Android. We are publishing wheels for ARM architectures, @julian-smith-artifex-com - any comment from your side?
Sorry, we do not build wheels for Android.
[We do build ARM wheels for 64-bit Linux and 64-bit MacOS.]
If Android wheels are built in the standard Python way with a frontend such as pip
that uses PyMuPDF's setup.py
script, then it may be possible.
But PyMuPDF needs MuPDF, and the Android build for MuPDF (https://mupdf.readthedocs.io/en/latest/android-library.html) looks like it uses Gradle, so i suspect it might be quite difficult to get everything to build correctly.
Alternatively, https://github.com/kivy/python-for-android looks like it might provide a way to handle things in a more standard Python way, so maybe take a look at it?
I Tried Building the app into an APK using Buildozer and it was successful, but when I launched the app, it crashed on launch and it reported:
python ImportError: dlopen failed: "/data/data/org.test.ehpaperless/files/app/_python_bundle/site-packages/fitz/_fitz.so" is for EM_X86_64 (62) instead of EM_AARCH64 (183)
So I was wondering if PyMuPDF supports Python for Android or not? since EM_X86_64 means that it requires x86 environment.
If it does, how do I change the .so file so it is runnable on ARM?