当前位置: 首页 > 工具软件 > PyMuPDF > 使用案例 >

M1Mac安装PyMuPDF的方法(with brew)

盖博简
2023-12-01

tags: Tips

写在前面

前阶段有人问我如何在M1芯片的macOS上安装PyMuPDF这个包, 我的环境是采用conda安装的Python3.9, 直接采用pip install fitz进行安装之后, 虽然成功安装了, 但是导入时候出现了报错, 后来通过github的讨论界面1得到了答案.

解决

pip install fitz
brew install mupdf swig freetype
pip install https://github.com/pymupdf/PyMuPDF/archive/master.tar.gz
pip install frontend

这样之后就不会有问题了.

❯ ipy
Python 3.8.12 | packaged by conda-forge | (default, Oct 12 2021, 21:21:17)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.24.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import fitz

In [2]:

  1. Unable to install under M1 Macintosh mode (works in x86/rosetta 2 mode) · Discussion #875 · pymupdf/PyMuPDF (github.com); ↩︎

 类似资料: