Mac OS wheels are not compatible with Monterey version 12.1 #1472
Replies: 18 comments
-
I ignored importing PyMuPDF, but app not working as well. I found the similar error on Numpy. Because the first time I found error is that it showed PyMuPDF (or maybe Fitz, I forgot it) xxxxx.
|
Beta Was this translation helpful? Give feedback.
-
I am not sure about what MacOS 12 means, but if it is not the Intel version (but that M1 stuff), there exist no wheels for you! This is what PIP on your machine is trying to do - and fails because it does not find MuPDF. |
Beta Was this translation helpful? Give feedback.
-
I just confirmed that the OSX wheels on PyPI work fine: they run on a Mac OSX 11 machine ... Please confirm my assumption, so I can close the issue. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your quick reply. I am also testing now. I am pretty sure that PyMuPDF works fine find under MacOS Monterey 12.0.1, for both M1 mbp and Intel mbp. Because I use this module everyday. Errors happened after upgrading to 12.1. (Intel works fine, M1 mbp failed) Actually I use Tkinter app built by apple script (programed by python). I found it is more complex than I thought. |
Beta Was this translation helpful? Give feedback.
-
I see ... and PyMuPDF installation failed? Or did it install and running it failed? |
Beta Was this translation helpful? Give feedback.
-
Failed to install. I tried many versions. From 1.18.x to 1.19.3, all failed. |
Beta Was this translation helpful? Give feedback.
-
Ok. Then I would try an installation from sources ...: first MuPDF, then PyMuPDF. |
Beta Was this translation helpful? Give feedback.
-
Yes, my pip is the latest, 21.3.1 |
Beta Was this translation helpful? Give feedback.
-
Do you know the platform tag for that new MacOS? You could try a dirty hack: download the wheel and rename it accordingly ... 😉 |
Beta Was this translation helpful? Give feedback.
-
Sorry. I am not a professional programmer. Even not sure how to build from source. I install all libraries from Pycharm pip only... |
Beta Was this translation helpful? Give feedback.
-
Well, in that case ... I am out of good advice. I would like to close and postpone this issue until the |
Beta Was this translation helpful? Give feedback.
-
Thank you so much. No problem, you could close this issue now. Thanks again for creating this awesome library. |
Beta Was this translation helpful? Give feedback.
-
What I meant was this:
When looking at how numpy wheels are named, this trick may work. But it is dirty as I said ...
|
Beta Was this translation helpful? Give feedback.
-
Thanks. However, ERROR: PyMuPDF-1.19.3-cp39-cp39-macosx_12_1_x86_64.whl is not a supported wheel on this platform. |
Beta Was this translation helpful? Give feedback.
-
I have build my own wheel on Docker for python:3.8.12-bullseye image from my M1 device. Here is my path to build it: Enter docker image with this: Then run this commands to install dependencies
After run this
Note: -j parameter is optimized with my docker config. Please change this with your cpu count for dedicated to Docker. After this, go to dist folder and store wheel file. Also I uploaded my wheel you can download it from here. |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot @kalaomer ! |
Beta Was this translation helpful? Give feedback.
-
Here is working Dockerfile example that can be used as base image (kudos to @kalaomer ): # FIXME: you are free to change python version
FROM python:3.6
RUN apt update && apt install -y python3-swiglpk swig libjbig-dev libjbig-dev libjbig2dec0-dev libjbig2dec0 libjbig-dev jbig2dec libgumbo-dev libgumbo1 python3-gumbo libharfbuzz-dev libharfbuzz-bin libghc-gi-harfbuzz-dev libmujs-dev mujs python3-mujson libmujs1
RUN apt install -y pkg-config python-dev
WORKDIR /src/mupdf
# FIXME: you can change mupdf version
RUN wget https://mupdf.com/downloads/archive/mupdf-1.19.0-source.tar.gz
RUN tar -zxvf mupdf-1.19.0-source.tar.gz
# FIXME: here you can change pymupdf version by setting git branch
RUN git clone https://github.com/pymupdf/PyMuPDF.git --depth 1 --branch 1.19.4
RUN ls -lah
# replace files in mupdf source
RUN cp PyMuPDF/fitz/_config.h mupdf-1.19.0-source/include/mupdf/fitz/config.h
WORKDIR /src/mupdf/mupdf-1.19.0-source
RUN ls -lah
ENV CFLAGS="-fPIC"
RUN make HAVE_X11=no HAVE_GLFW=no HAVE_GLUT=no HAVE_LEPTONICA=no HAVE_TESSERACT=no -j 4 prefix=/usr/local
RUN make HAVE_X11=no HAVE_GLFW=no HAVE_GLUT=no HAVE_LEPTONICA=no HAVE_TESSERACT=no -j 4 prefix=/usr/local install
WORKDIR /src/mupdf/PyMuPDF
RUN python setup.py build
RUN python setup.py install
RUN python setup.py bdist_wheel |
Beta Was this translation helpful? Give feedback.
-
I resolved it. Learnt it from Stackoverflow. Then Done |
Beta Was this translation helpful? Give feedback.
-
Please provide all mandatory information!
Describe the bug (mandatory)
I have used your PyMuPDF for one year! Thanks for your effort.
I upgraded system to MacOS 12.1 today, then something about Xcode upgraded automatically. Simultaneously, I upgraded PyMuPDF from 1.19.2 to 1.19.3. After that ,I run my routine self-design app but failed. Showing Fitz error. Considering it is working properly on another Intel MBP.(all libraries are the same,incl versions), I supposed maybe 1.19.3 was incompatible for M1 MBP. I tried to downgrade or remove but failed, so deleted Fitz & PyMuPDF library manually and tried to reinstall it.
Now, always failed and showing below. (via Pycharm and terminal, all failed)
I tried to install other lib, successful. So maybe it is something about Fitz or PyMuPDF?
To Reproduce (mandatory)
install, always failed
Expected behavior (optional)
install successfully and no error on loading.
Screenshots (optional)
described as above
Your configuration (mandatory)
For example, the output of
print(sys.version, "\n", sys.platform, "\n", fitz.__doc__)
would be sufficient (for the first two bullets).Additional context (optional)
Beta Was this translation helpful? Give feedback.
All reactions