Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install the PyMuPDF python package. #222

Open
BabuNamburi opened this issue Jun 4, 2021 · 0 comments
Open

Unable to install the PyMuPDF python package. #222

BabuNamburi opened this issue Jun 4, 2021 · 0 comments

Comments

@BabuNamburi
Copy link

I am trying to install the PyMuPDF python on tiangolo/uwsgi-nginx-flask:python3.8-alpine. I am seeing the following errors:
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-5cww62wp/PyMuPDF/setup.py'"'"'; __file__='"'"'/tmp/pip-install-5cww62wp/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-vw1mjidt cwd: /tmp/pip-install-5cww62wp/PyMuPDF/ Complete output (374 lines): running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.8 creating build/lib.linux-x86_64-3.8/fitz copying fitz/__init__.py -> build/lib.linux-x86_64-3.8/fitz copying fitz/fitz.py -> build/lib.linux-x86_64-3.8/fitz copying fitz/utils.py -> build/lib.linux-x86_64-3.8/fitz copying fitz/__main__.py -> build/lib.linux-x86_64-3.8/fitz running build_ext building 'fitz._fitz' extension creating build/temp.linux-x86_64-3.8 creating build/temp.linux-x86_64-3.8/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 -Imupdf/thirdparty/freetype/include -I/usr/local/include/python3.8 -c fitz/fitz_wrap.c -o build/temp.linux-x86_64-3.8/fitz/fitz_wrap.o fitz/fitz_wrap.c: In function 'JM_get_page_labels': fitz/fitz_wrap.c:3591:37: warning: passing argument 3 of 'fz_buffer_storage' from incompatible pointer type [-Wincompatible-pointer-types] 3591 | fz_buffer_storage(ctx, res, &c); | ^~ | | | char ** In file included from /usr/local/include/mupdf/fitz/output.h:6, from /usr/local/include/mupdf/fitz/hash.h:6, from /usr/include/mupdf/fitz.h:16, from fitz/fitz_wrap.c:2767: /usr/local/include/mupdf/fitz/buffer.h:50:75: note: expected 'unsigned char **' but argument is of type 'char **' 50 | size_t fz_buffer_storage(fz_context *ctx, fz_buffer *buf, unsigned char **datap); | ~~~~~~~~~~~~~~~~^~~~~ fitz/fitz_wrap.c: In function 'JM_get_fontbuffer': fitz/fitz_wrap.c:4165:11: warning: variable 'ext' set but not used [-Wunused-but-set-variable] 4165 | char *ext = NULL; | ^~~ fitz/fitz_wrap.c: In function 'JM_invert_pixmap_rect': fitz/fitz_wrap.c:4676:19: warning: operation on 's' may be undefined [-Wsequence-point] 4676 | *s++ = 255 - *s; | ~^~ fitz/fitz_wrap.c:4677:30: warning: value computed is not used [-Wunused-value] 4677 | if (dest->alpha) *s++; | ^~~~ fitz/fitz_wrap.c: In function 'JM_image_profile': fitz/fitz_wrap.c:4716:11: warning: pointer targets in assignment from 'char *' to 'unsigned char *' differ in signedness [-Wpointer-sign] 4716 | c = PyBytes_AS_STRING(imagedata); | ^ fitz/fitz_wrap.c:4719:11: warning: pointer targets in assignment from 'char *' to 'unsigned char *' differ in signedness [-Wpointer-sign] 4719 | c = PyByteArray_AS_STRING(imagedata); | ^ fitz/fitz_wrap.c: In function 'JM_delete_annot': fitz/fitz_wrap.c:5172:18: warning: unused variable 'popup' [-Wunused-variable] 5172 | pdf_obj *popup = pdf_dict_get(ctx, annot->obj, PDF_NAME(Popup)); | ^~~~~ fitz/fitz_wrap.c: In function 'JM_get_annot_by_xref': fitz/fitz_wrap.c:5355:12: warning: unused variable 'len' [-Wunused-variable] 5355 | size_t len = 0; | ^~~ fitz/fitz_wrap.c: In function 'JM_append_rune': fitz/fitz_wrap.c:5411:18: warning: suggest parentheses around '&&' within '||' [-Wparentheses] 5411 | if (ch >= 32 && ch <= 127 || ch == 10) { | ~~~~~~~~~^~~~~~~~~~~~ fitz/fitz_wrap.c: In function 'JM_new_javascript': fitz/fitz_wrap.c:6283:47: warning: pointer targets in passing argument 2 of 'fz_new_buffer_from_copied_data' differ in signedness [-Wpointer-sign] 6283 | res = fz_new_buffer_from_copied_data(ctx, data, strlen(data)); | ^~~~ | | | char * In file included from /usr/local/include/mupdf/fitz/output.h:6, from /usr/local/include/mupdf/fitz/hash.h:6, from /usr/include/mupdf/fitz.h:16, from fitz/fitz_wrap.c:2767: /usr/local/include/mupdf/fitz/buffer.h:83:12: note: expected 'const unsigned char *' but argument is of type 'char *' 83 | fz_buffer *fz_new_buffer_from_copied_data(fz_context *ctx, const unsigned char *data, size_t size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fitz/fitz_wrap.c: In function 'JM_choice_options': fitz/fitz_wrap.c:6662:19: warning: unused variable 'pdf' [-Wunused-variable] 6662 | pdf_document *pdf = pdf_get_bound_document(ctx, annot->obj); | ^~~ fitz/fitz_wrap.c: In function 'JM_get_widget_properties': fitz/fitz_wrap.c:6720:16: warning: unused variable 'res' [-Wunused-variable] 6720 | fz_buffer *res = NULL; | ^~~ fitz/fitz_wrap.c:6719:39: warning: unused variable 'o' [-Wunused-variable] 6719 | pdf_obj *obj = NULL, *js = NULL, *o = NULL; | ^ fitz/fitz_wrap.c:6719:27: warning: unused variable 'js' [-Wunused-variable] 6719 | pdf_obj *obj = NULL, *js = NULL, *o = NULL; | ^~ fitz/fitz_wrap.c: In function 'JM_set_widget_properties': fitz/fitz_wrap.c:6854:9: warning: variable 'result' set but not used [-Wunused-but-set-variable] 6854 | int result = 0; | ^~~~~~ fitz/fitz_wrap.c: In function 'JM_embed_file': fitz/fitz_wrap.c:7119:64: warning: pointer targets in passing argument 2 of 'fz_new_buffer_from_copied_data' differ in signedness [-Wpointer-sign] 7119 | fz_new_buffer_from_copied_data(ctx, " ", 1), | ^~~~ | | | char * In file included from /usr/local/include/mupdf/fitz/output.h:6, from /usr/local/include/mupdf/fitz/hash.h:6, from /usr/include/mupdf/fitz.h:16, from fitz/fitz_wrap.c:2767: /usr/local/include/mupdf/fitz/buffer.h:83:12: note: expected 'const unsigned char *' but argument is of type 'char *' 83 | fz_buffer *fz_new_buffer_from_copied_data(fz_context *ctx, const unsigned char *data, size_t size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fitz/fitz_wrap.c: In function 'JM_set_ocg_arrays': fitz/fitz_wrap.c:7912:40: warning: unused variable 'indobj' [-Wunused-variable] 7912 | pdf_obj *arr = NULL, *obj = NULL, *indobj = NULL; | ^~~~~~ fitz/fitz_wrap.c: At top level: fitz/fitz_wrap.c:8703:40: warning: 'struct Document' declared inside parameter list will not be visible outside of this definition or declaration 8703 | SWIGINTERN void delete_Document(struct Document *self){ | ^~~~~~~~ fitz/fitz_wrap.c: In function 'Document_load_page': fitz/fitz_wrap.c:8997:23: warning: unused variable 'val' [-Wunused-variable] 8997 | PyObject *val = NULL; | ^~~ fitz/fitz_wrap.c: In function 'Document__embfile_add': fitz/fitz_wrap.c:9566:20: warning: variable 'size' set but not used [-Wunused-but-set-variable] 9566 | size_t size = 0; | ^~~~ fitz/fitz_wrap.c:9565:17: warning: unused variable 'entry' [-Wunused-variable] 9565 | int entry = 0; | ^~~~~ fitz/fitz_wrap.c: In function 'Document_next_location': fitz/fitz_wrap.c:9766:17: warning: unused variable 'page_n' [-Wunused-variable] 9766 | int page_n = -1; | ^~~~~~ fitz/fitz_wrap.c: In function 'Document__getPDFfileid': fitz/fitz_wrap.c:10008:68: warning: pointer targets in passing argument 1 of 'JM_UnicodeFromStr' differ in signedness [-Wpointer-sign] 10008 | LIST_APPEND_DROP(idlist, JM_UnicodeFromStr(hex)); | ^~~ | | | unsigned char * fitz/fitz_wrap.c:3623:41: note: expected 'const char *' but argument is of type 'unsigned char *' 3623 | PyObject *JM_UnicodeFromStr(const char *c) | ~~~~~~~~~~~~^ fitz/fitz_wrap.c: At top level: fitz/fitz_wrap.c:10100:194: warning: 'struct Graftmap' declared inside parameter list will not be visible outside of this definition or declaration 10100 | SWIGINTERN PyObject *Document_insert_pdf(struct Document *self,struct Document *docsrc,int from_page,int to_page,int start_at,int rotate,int links,int annots,int show_progress,int final,struct Graftmap *_gmap){ | ^~~~~~~~ fitz/fitz_wrap.c: In function 'Document__get_char_widths': fitz/fitz_wrap.c:10224:36: warning: unused variable 'fb_font' [-Wunused-variable] 10224 | fz_font *font = NULL, *fb_font= NULL; | ^~~~~~~ fitz/fitz_wrap.c:10221:17: warning: unused variable 'lang' [-Wunused-variable] 10221 | int lang = 0; | ^~~~ fitz/fitz_wrap.c:10220:17: warning: unused variable 'cwlen' [-Wunused-variable] 10220 | int cwlen = 0; | ^~~~~ fitz/fitz_wrap.c: In function 'Document_extract_font': fitz/fitz_wrap.c:10370:24: warning: unused variable 'len' [-Wunused-variable] 10370 | Py_ssize_t len = 0; | ^~~ fitz/fitz_wrap.c: In function 'Document_fullcopy_page': fitz/fitz_wrap.c:11018:69: warning: pointer targets in passing argument 2 of 'fz_new_buffer_from_copied_data' differ in signedness [-Wpointer-sign] 11018 | fz_new_buffer_from_copied_data(gctx, " ", 1), NULL, 0); | ^~~~ | | | char * In file included from /usr/local/include/mupdf/fitz/output.h:6, from /usr/local/include/mupdf/fitz/hash.h:6, from /usr/include/mupdf/fitz.h:16, from fitz/fitz_wrap.c:2767: /usr/local/include/mupdf/fitz/buffer.h:83:12: note: expected 'const unsigned char *' but argument is of type 'char *' 83 | fz_buffer *fz_new_buffer_from_copied_data(fz_context *ctx, const unsigned char *data, size_t size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fitz/fitz_wrap.c:10977:22: warning: unused variable 'page2' [-Wunused-variable] 10977 | pdf_obj *page2 = NULL; | ^~~~~ fitz/fitz_wrap.c: In function 'Document__move_copy_page': fitz/fitz_wrap.c:11054:26: warning: unused variable 'page2' [-Wunused-variable] 11054 | pdf_obj *page2 = pdf_lookup_page_loc(gctx, pdf, nb, &parent2, &i2); | ^~~~~ fitz/fitz_wrap.c: In function 'Document__get_page_labels': fitz/fitz_wrap.c:11185:24: warning: unused variable 'res' [-Wunused-variable] 11185 | fz_buffer *res = NULL; | ^~~ fitz/fitz_wrap.c: In function 'Page_get_svg_image': fitz/fitz_wrap.c:11664:29: warning: unused variable 'seps' [-Wunused-variable] 11664 | fz_separations *seps = NULL; | ^~~~ fitz/fitz_wrap.c: At top level: fitz/fitz_wrap.c:12179:104: warning: 'struct Colorspace' declared inside parameter list will not be visible outside of this definition or declaration 12179 | SWIGINTERN struct Pixmap *Page__makePixmap(struct Page *self,struct Document *doc,PyObject *ctm,struct Colorspace *cs,int alpha,int annots,PyObject *clip){ | ^~~~~~~~~~ fitz/fitz_wrap.c:12408:151: warning: 'struct Graftmap' declared inside parameter list will not be visible outside of this definition or declaration 12408 | SWIGINTERN PyObject *Page__show_pdf_page(struct Page *self,struct Page *fz_srcpage,int overlay,PyObject *matrix,int xref,int oc,PyObject *clip,struct Graftmap *graftmap,char *_imgname){ | ^~~~~~~~ fitz/fitz_wrap.c: In function 'Page__insertImage':

Attached are the minimalistic example files to reproduce the errors.

Any help would be highly appreciated.
requirements.txt
Dockerfile.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant