0

Morning

To start out, let me just say I'm a python novice - so I hope this question isn't going to be stupid.

I'm running Mac 10.13.4 (Beta) and am trying to get PyMuPDF working.

As per https://github.com/rk700/PyMuPDF/:

  • I've downloaded both PyMuPDf and MuPDF.
  • I ran brew install mupdf-tools
  • I ran export ARCHFLAGS='-arch x86_64'

At this point I am not sure whether I need to build MuPDF by running

make prefix=/usr/local install

(as per https://mupdf.com/docs/building.html) or go straight to

python setup.py install

If I try build mupdf using make, then I get the following error:

include/mupdf/fitz/config.h:92:1: error: expected identifier or '('
... ... ...
^
In file included from source/fitz/archive.c:1:
In file included from include/mupdf/fitz.h:35:
include/mupdf/fitz/pixmap.h:360:2: error: unknown type name 'ptrdiff_t'
        ptrdiff_t stride;

If I run the setup.py install, then I get errors when trying to import Fitz. I know that there is an instruction saying that the include_dirs and library_dirs should be updated, but the directories they refer to do not appear to be there (other that in the source files I downloaded).

I appreciate that this is all down to me being a python rookie - any pointers would be greatly appreciated.

Vishal Singh
  • 6,014
  • 2
  • 17
  • 33
  • You haven't mentioned what errors are caused by importing `Fitz`; but the `make install` error means that the version of `mu-pdf` you downloaded `brew` is either incompatible with your C compiler, or not production-ready. – jpaugh Feb 06 '18 at 21:37
  • Can you get a different version with brew? – jpaugh Feb 06 '18 at 21:38
  • I pulled mupdf from here https://mupdf.com/downloads/ This is the official download page - the git version is a dev release, so the one I have should be ok. – Michael Cox Feb 06 '18 at 23:29

0 Answers0