Closed
Description
I am unable to install pymupdf under Mac OS X Big Sur Native M1 (eg pip install PyMuPDF), whereas in Intel mode (Rosetta 2/aka Intel translation mode) it works without any issue.
(quickbbs) benjamin@Nerv quickbbs % pip install pymupdf
Collecting pymupdf
Using cached PyMuPDF-1.18.6.tar.gz (258 kB)
Using legacy 'setup.py install' for pymupdf, since package 'wheel' is not installed.
Installing collected packages: pymupdf
Running setup.py install for pymupdf ... error
ERROR: Command errored out with exit status 1:
command: /Users/benjamin/venvs/quickbbs/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/6g/0vldjqgd5d55rdv163phqh6r0000gn/T/pip-install-dqerqvac/pymupdf_74020f613ca84fc09a79e826a22842db/setup.py'"'"'; __file__='"'"'/private/var/folders/6g/0vldjqgd5d55rdv163phqh6r0000gn/T/pip-install-dqerqvac/pymupdf_74020f613ca84fc09a79e826a22842db/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/6g/0vldjqgd5d55rdv163phqh6r0000gn/T/pip-record-lq0xtd43/install-record.txt --single-version-externally-managed --compile --install-headers /Users/benjamin/venvs/quickbbs/include/site/python3.9/pymupdf
cwd: /private/var/folders/6g/0vldjqgd5d55rdv163phqh6r0000gn/T/pip-install-dqerqvac/pymupdf_74020f613ca84fc09a79e826a22842db/
Complete output (20 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-11-arm64-3.9
creating build/lib.macosx-11-arm64-3.9/fitz
copying fitz/__init__.py -> build/lib.macosx-11-arm64-3.9/fitz
copying fitz/fitz.py -> build/lib.macosx-11-arm64-3.9/fitz
copying fitz/utils.py -> build/lib.macosx-11-arm64-3.9/fitz
copying fitz/__main__.py -> build/lib.macosx-11-arm64-3.9/fitz
running build_ext
building 'fitz._fitz' extension
creating build/temp.macosx-11-arm64-3.9
creating build/temp.macosx-11-arm64-3.9/fitz
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/opt/homebrew/include -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/opt/homebrew/opt/openssl@1.1/include -I/usr/local/include/mupdf -I/usr/local/include -Imupdf/thirdparty/freetype/include -I/opt/homebrew/include -I/opt/homebrew/opt/openssl@1.1/include -I/opt/homebrew/opt/sqlite/include -I/opt/homebrew/opt/tcl-tk/include -I/Users/benjamin/venvs/quickbbs/include -I/opt/homebrew/Cellar/python@3.9/3.9.1_6/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c fitz/fitz_wrap.c -o build/temp.macosx-11-arm64-3.9/fitz/fitz_wrap.o
fitz/fitz_wrap.c:2767:10: fatal error: 'fitz.h' file not found
#include <fitz.h>
^~~~~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/benjamin/venvs/quickbbs/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/6g/0vldjqgd5d55rdv163phqh6r0000gn/T/pip-install-dqerqvac/pymupdf_74020f613ca84fc09a79e826a22842db/setup.py'"'"'; __file__='"'"'/private/var/folders/6g/0vldjqgd5d55rdv163phqh6r0000gn/T/pip-install-dqerqvac/pymupdf_74020f613ca84fc09a79e826a22842db/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/6g/0vldjqgd5d55rdv163phqh6r0000gn/T/pip-record-lq0xtd43/install-record.txt --single-version-externally-managed --compile --install-headers /Users/benjamin/venvs/quickbbs/include/site/python3.9/pymupdf Check the logs for full command output.
It appears that it is being built and the wheel is being ignored.
Your configuration (mandatory)
-
MAc OS X Big Sur, M1 Mac Mini w/16 Gb Ram
-
Python 3.9.1 (default, Jan 8 2021, 12:11:08)
[Clang 12.0.0 (clang-1200.0.32.28)] on darwin -
PyMuPDF Using cached PyMuPDF-1.18.6.tar.gz (258 kB)
Additional context (optional)
I suspect that the Universal 2 wheel just needs to be created. Cryptography, and Pillow within the last day, just started to work in M1 Native mode, due to Wheel support being added to the build systems...
If there is anything that I can assist with or help, please feel free to let me know. I'd be happy to assist.