The instructions provided by Juan Garcia worked until June 18th 2022 for me. There's a few workarounds.
Solution #1
Install the wheel
package using pip and swig
+ freetype
using homebrew. PyMuPDF should build itself successfully when running pip install pymupdf
. This takes about five minutes on a late model M1 MBP. This does not require the mupdf
package installed via homebrew.
Solution #2
If you're using homebrew you can downgrade to 1.19.x
with the following:
cd "$(brew --repo homebrew/core)" && git checkout 457cb59a52ff7666dc146c1c480d2ea98d63564f;
# If you already have mupdf installed use `brew reinstall` instead of `brew install`
cd "$(brew --repo homebrew/core)" && HOMEBREW_NO_AUTO_UPDATE=1 brew install mupdf;
cd "$(brew --repo homebrew/core)" && git checkout master && brew pin mupdf;
brew install swig freetype;
pip install https://github.com/pymupdf/PyMuPDF/archive/refs/tags/1.19.6.tar.gz;
For reference here is the Formula commit history: https://github.com/Homebrew/homebrew-core/commits/master/Formula/mupdf.rb