diverse-project / varylatex

Varying LaTeX for fitting your requirements
7 stars 2 forks source link

There is a problem building the docker images due fitz.h not found when installing mupdf #25

Open jagalindo opened 3 years ago

jagalindo commented 3 years ago

Currently testing this on a PopOS 20.04 machine and the docker 20.10.8, build 3967b7d under zsh.

In the process of building the image we encounter a fitz.h not found when installing pymupdf. See the trace below:

 ERROR: Command errored out with exit status 1:
   command: /usr/local/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-5pmjpkhz/pymupdf_4ef0a9d2aaf943c8ae538025e8460d5b/setup.py'"'"'; __file__='"'"'/tmp/pip-install-5pmjpkhz/pymupdf_4ef0a9d2aaf943c8ae538025e8460d5b/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-gad3wos6
       cwd: /tmp/pip-install-5pmjpkhz/pymupdf_4ef0a9d2aaf943c8ae538025e8460d5b/
  Complete output (20 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.9
  creating build/lib.linux-x86_64-3.9/fitz
  copying fitz/__init__.py -> build/lib.linux-x86_64-3.9/fitz
  copying fitz/fitz.py -> build/lib.linux-x86_64-3.9/fitz
  copying fitz/utils.py -> build/lib.linux-x86_64-3.9/fitz
  copying fitz/__main__.py -> build/lib.linux-x86_64-3.9/fitz
  running build_ext
  building 'fitz._fitz' extension
  creating build/temp.linux-x86_64-3.9
  creating build/temp.linux-x86_64-3.9/fitz
  gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/mupdf -I/usr/local/include/mupdf -I/usr/local/include/python3.9 -c fitz/fitz_wrap.c -o build/temp.linux-x86_64-3.9/fitz/fitz_wrap.o
  fitz/fitz_wrap.c:2733:10: fatal error: fitz.h: No such file or directory
   2733 | #include <fitz.h>
        |          ^~~~~~~~
  compilation terminated.
  error: command '/usr/bin/gcc' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for PyMuPDF

Probably if we add the packages mupdf mupdf-tools libmupdf-dev in the dockerfile the problem gets resolved. 'll be PR'ing a commit to solve that.