Skip to content

Question / Comment: Installing PyMuPDF with pip on alpine linux #391

@kharann

Description

@kharann

Hi i keep trying to install PyMuPDF in a docker container running alpine linux.
I read around a bit and tried to add mupdf before pip installing without any success

apk add --virtual .build-deps gcc python3-dev musl-dev libffi-dev \
  # TODO workaround start
  && apk add libressl-dev \
  && apk add openssl-dev \
  && apk add python3-dev \
  && apk add mupdf \
  && pip install --upgrade pip  \
  && pip install PyMuPDF \

But it seems like im getting some weird kind of wheel error? Any guidance on the issue??

Collecting PyMuPDF
  Downloading https://files.pythonhosted.org/packages/27/9d/22195340c713be7e203af6551b5cf43b50f7394e5120e0f464485524ea02/PyMuPDF-1.16.6.tar.gz (165kB)
Building wheels for collected packages: PyMuPDF
  Building wheel for PyMuPDF (setup.py): started
  Building wheel for PyMuPDF (setup.py): finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-eimjk5e9/PyMuPDF/setup.py'"'"'; __file__='"'"'/tmp/pip-install-eimjk5e9/PyMuPDF/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-rmotb7uw --python-tag cp37
       cwd: /tmp/pip-install-eimjk5e9/PyMuPDF/
  Complete output (19 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.7
  creating build/lib.linux-x86_64-3.7/fitz
  copying fitz/__init__.py -> build/lib.linux-x86_64-3.7/fitz
  copying fitz/fitz.py -> build/lib.linux-x86_64-3.7/fitz
  copying fitz/utils.py -> build/lib.linux-x86_64-3.7/fitz
  running build_ext
  building 'fitz._fitz' extension
  creating build/temp.linux-x86_64-3.7
  creating build/temp.linux-x86_64-3.7/fitz
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/include/mupdf -I/usr/local/include/mupdf -I/usr/local/include/python3.7m -c fitz/fitz_wrap.c -o build/temp.linux-x86_64-3.7/fitz/fitz_wrap.o
  fitz/fitz_wrap.c:2732:10: fatal error: fitz.h: No such file or directory
   #include <fitz.h>
            ^~~~~~~~
  compilation terminated.
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for PyMuPDF
  Running setup.py clean for PyMuPDF
Failed to build PyMuPDF
Installing collected packages: PyMuPDF
    Running setup.py install for PyMuPDF: started
    Running setup.py install for PyMuPDF: finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-eimjk5e9/PyMuPDF/setup.py'"'"'; __file__='"'"'/tmp/pip-install-eimjk5e9/PyMuPDF/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-be3wrjpu/install-record.txt --single-version-externally-managed --compile
         cwd: /tmp/pip-install-eimjk5e9/PyMuPDF/
    Complete output (19 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.7
    creating build/lib.linux-x86_64-3.7/fitz
    copying fitz/__init__.py -> build/lib.linux-x86_64-3.7/fitz
    copying fitz/fitz.py -> build/lib.linux-x86_64-3.7/fitz
    copying fitz/utils.py -> build/lib.linux-x86_64-3.7/fitz
    running build_ext
    building 'fitz._fitz' extension
    creating build/temp.linux-x86_64-3.7
    creating build/temp.linux-x86_64-3.7/fitz
    gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/include/mupdf -I/usr/local/include/mupdf -I/usr/local/include/python3.7m -c fitz/fitz_wrap.c -o build/temp.linux-x86_64-3.7/fitz/fitz_wrap.o
    fitz/fitz_wrap.c:2732:10: fatal error: fitz.h: No such file or directory
     #include <fitz.h>
              ^~~~~~~~
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-eimjk5e9/PyMuPDF/setup.py'"'"'; __file__='"'"'/tmp/pip-install-eimjk5e9/PyMuPDF/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-be3wrjpu/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions