izderadicka / pdfparser

Python binding to libpoppler with focus on text extraction
97 stars 45 forks source link

Mac Error #18

Closed ofirziv closed 5 years ago

ofirziv commented 5 years ago

Trying to install on mac by the following commands:

pip install cython pip install git+https://github.com/izderadicka/pdfparser

I received the following error:

pdfparser/poppler.cpp:8741:41: error: assigning to 'char ' from incompatible type 'const char ' pyx_t_12 = pyx_v_font_name->getCString();


    pdfparser/poppler.cpp:8840:29: error: assigning to 'char *' from incompatible type 'const char *'
        __pyx_t_12 = __pyx_v_s->getCString();
                     ~~~~~~~~~~~^~~~~~~~~~~~
    9 warnings and 2 errors generated.
    error: command 'clang' failed with exit status 1

    ----------------------------------------
Command "PATH/python2.7 -u -c "import setuptools, tokenize;__file__='....../pip-req-build-so5oPb/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record .....pip-record-bsmG7I/install-record.txt --single-version-externally-managed --compile --install-headers .../include/site/python2.7/pdfparser" failed with error code 1 in .....T/pip-req-build-so5oPb/

I've received this error on various of different macs.

Looking forward to your help,
Thanks
izderadicka commented 5 years ago

Sorry I do not support MacOS, as I do not have the platform - errors are from clang c++ compiler so I guess it's about compatibility and option settings for that. See also closed issues - there has been some comments from Mac users.

izderadicka commented 5 years ago

Look into setup.py, these are specific options for clang:

mac_compile_args = ["-std=c++11", "-stdlib=libc++", "-mmacosx-version-min=10.7"]

try to experiment there, PR if you find solution.

izderadicka commented 5 years ago

resolved in PR #20 thanks to @AvnerCohen