-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pip install fails when installing pymupdf on macOS Big Sur #7
Comments
Hello @martin-braun, I am sorry to hear that your setup has been way too complicated. During mine, I used poetry (instead of pip) on a macOS Catalina machine and everything went by as smooth as it gets. It seems you are using a developer beta version (11.1) of the recently released macOS Big Sur. I have no direct experience with Big Sur yet, but judging from your stack trace and my experience with previous macOS releases, my first guess is that Apple made changes related to clang that are in conflict with PyMuPDF. Have you googled about it? Since you already reported the issue to PyMuPDF, I would wait for their response there. If their solution requires a patch in a new version of PyMuPDF, please let me know. I am happy to bump the PyMuPDF version that remarks depends on from 1.17.4 to anything newer that solves your issue. Thanks |
Hi @lucasrla, thank you for taking time looking into my issue. I really appreciate it.
So in other words, on Catalina it would also install MuPDF together with PyMuPDF? I'd like to avoid Poetry, because I want to a build a bash script that does syncing, installation and exporting all in once. The real headache is not to use pip instead of poetry, it's the fact that I have to extract files from MuPDF to insert into PyMuPDF as well as the manual install of MuPDF itself. If you tell me that this is all not necessary and (even with pip) it should install without any additional steps, I'm happy, although it would mean that I have to wait. Btw, I even tested
Unfortunately, my research is not that straightforward regarding this. However the dates of the latest releases are promising to support Big Sur, but 1.17.4 is too old, to be handle Big Sur abnormalities on Clang.
Someone tries to build it on Big Sur by his own, but there is no report back. At least it indicates that you are probably right. Thank you for taking action in case it is required to port your software to Big Sur. Best regards! |
Unfortunately it doesn't seem like using poetry would solve your issue today. My installation went through very smoothly because poetry automatically pulled one of the wheels that PyMuPDF have made available. The wheels are pre-built and include MuPDF. I have just stumbled upon a thread regarding pip on Big Sur that provides great insight on what might be happening with you. It is worth reading it all (it is kind of surreal). Then, try this: pip install --platform macosx_10_9_x86_64 --only-binary=:all: --target=/tmp pymupdf If the above does not work (nor any other solution posted there), then we are in deeper trouble. The alternative path that PyMuPDF recommends is building it from the source. From your first post, it seems like you followed that path already (without much success). Side note – If I may, I would say that the important meta lesson with this issue is: if you rely on developer tools, wait before doing major OS upgrades. It always takes time (months?) before things are fully sorted out (especially with Apple and Python, which don't seem to be as in sync as they should). Best regards PS: If the suggestion above does not work and you need to further experiment with flags, here is a nice guide by Real Python about wheels. |
I just had a quick look at the PR aimed to fix the issue with Big Sur and wheels. It seems the fix has been merged to master and is part of This commit from 2020-11-30 indicates that These discoveries made me a bit more pessimist about the ideas and solutions that I have shared so far... Maybe the root cause of your issue is something else. I don't really know. Looking forward to hearing your findings with the experiments that I have proposed so far. |
I just had a new idea that sounds very promising. There is no pre-built wheel for CPython 3.9 in PyMuPDF 1.17.4. But there are pre-built wheels for CPython 3.9 since PyMuPDF 1.17.7. That is expected since Python 3.9 came out in early October 2020 and 1.17.4 was released in July 2020. In other words, my current hypothesis is: the actual reason If that is the culprit, it should be easy to fix. I will look into that later today. |
Meanwhile, can you please edit the From:
To:
And report back if you are able to install and use Thanks |
Hey @martin-braun, I just bumped PyMuPDF and Shapely versions (commit 26254dc). Whenever you have the time, please do let me know if that solves your installation issue on Python 3.9 and macOS Big Sur. Thanks |
Hey @lucasrla, thank you for your effort and time.
Yes, I get that. I had reasons to update and I knew the risk that comes with it. I'm just here to report the issue. :) I retried the installation with the HEAD of the master. It keeps failing:
I tried to purge the cache and update pip, but it keeps using PyMuPDF 1.18.5 and pip won't be updated, too. Then, I found out that rmapi allows me to export annotations from my rM and I don't even need to sync the files by my own ( If you wish, I can retry to install it, later. But I would not consider using remarks, if I have to sync the files by my own. Good luck with it and Happy Christmas! |
Thanks for the update, @martin-braun. Great to know that Re your installation issues with In your first log, we had:
But your latest log states that:
You wrote that "pip won't be updated", and that's weird. Have you tried to run Unfortunately, as of today, it seems that the only option for an easy installation of It is a pity that I am not able to reproduce your macOS Big Sur setup. So, if you have the time to test this out, I would really appreciate it. (As you can probably tell, I really want to nail this issue down – even if only for the benefit of other users.) Just to make sure it is clear:
Thank you in advance and all the best for you as well! PS: I don't expect the use of PyMuPDF 1.18.5 (instead of 1.18.4) to be the offender here. Both versions should be fine. |
Due to inactivity I will close this issue for now. In any case, we now have confirmations that
|
Sorry for the late reply. I'm just too distracted by projects now and as Maybe I will review my script and fix those issues to a later time, so I welcome this issue being closed, because I doubt it will lead to something. In the future I might try to fix it. In case of any trouble, I will open a new issue, then. Thank you for everything, nonetheless. |
I want to export annotations from my PDFs on my reMarkable 2, so I'm trying to install this, but it fails:
I had a bunch of other installation issues before, that I fixed. First of, I had to
brew install geos
to get past the first issue. Then the fitz.c was missing, because apparently pymupdf needs mupdf, but according to this comment by the author of PyMuPDF it needs to the correct version (same major and minor version). Since remarks uses PyMuPDF 1.17.4 I downloaded MuPDF 1.17.0, extracted it and moved the mupdf folder in the include folder into /usr/local/include. This didn't work, so I followed this other comment by the author of PyMuPDF, so I replaced /usr/local/include/mupdf/fitz/config.h with the fitz/_config.h file from the PyMuPDF release 1.17.4.An so, I get this error above. I'm stuck and I feel this whole process is way to complicated. It would be great to automate this installation somehow, but for now I just want this to work, any suggestions how I can get this to work?
My setup:
The text was updated successfully, but these errors were encountered: