Incompatibility with poppler v. 25 on macOS
macOS 14.7.2 Homebrew 4.4.21 poppler: stable 25.02.0 (bottled), HEAD Python 3.13.2 python-poppler 0.4.1
After upgrading poppler via Homebrew to v. 25 got the following error (reducted for personal data):
(VENV) $ ./myscript.py mydocument.pdf
Traceback (most recent call last):
File "/Users/myself/myproj/./myscript.py", line 6, in <module>
import poppler
File "/Users/myself/myproj/pyenv3.13.2/lib/python3.13/site-packages/poppler/__init__.py", line 20, in <module>
from poppler.utilities import version
File "/Users/myself/myproj/pyenv3.13.2/lib/python3.13/site-packages/poppler/utilities.py", line 26, in <module>
from poppler.cpp.version import version_major, version_minor, version_micro
ImportError: dlopen(/Users/myself/myproj/pyenv3.13.2/lib/python3.13/site-packages/poppler/cpp/version.cpython-313-darwin.so, 0x0002): Library not loaded: /opt/homebrew/opt/poppler/lib/libpoppler-cpp.1.dylib
Referenced from: <948B8188-16BF-3BD3-BC9D-C1C6B12E2A56> /Users/myself/myproj/pyenv3.13.2/lib/python3.13/site-packages/poppler/cpp/version.cpython-313-darwin.so
Reason: tried: '/opt/homebrew/opt/poppler/lib/libpoppler-cpp.1.dylib' (no such file), ... , '/usr/lib/libpoppler-cpp.1.dylib' (no such file, not in dyld cache)
On closer inspection indeed the only poppler cpp library available was:
/opt/homebrew/lib/libpoppler-cpp.2.dylib
As a workaround compiled libpoppler-cpp.1.dylib from the latest poppler v.24 source.
Hello, You can also remove poppler version 25 and install poppler 24 instead, I just made 2 home-brew formulas for installing either poppler version 23 and poppler 24 ; https://github.com/AntoineHus/homebrew-poppler-build
The combinaison python-poppler 0.4.1 + poppler version 24 works on Mac.
Hi,
I’m trying to install poppler in order to develop my own AgentAI, but I’m fighting with the error showed below.
Is it a problem of poppler 25? I installed it via homebrew. If it is so, how can I install poppler 24 without compiling it manually? I don’t like use homebrew, I usually install apps or dependency via pkg files or disk files.
Thanks in advance for any response.
ERROR
FAILED: src/cpp/image.cpython-312-darwin.so.p/image.cpp.o c++ -Isrc/cpp/image.cpython-312-darwin.so.p -Isrc/cpp -I../src/cpp -I../subprojects/pybind11-2.10.3/include -I/opt/homebrew/Cellar/poppler 5.09.1/include/poppler/cpp -I/opt/homebrew/Cellar/poppler/25.09.1/include/poppler -I/opt/homebrew/Cellar/fontconfig/2.17.1/include -I/opt/home rew/opt/freetype/include/freetype2 -I/opt/homebrew/Cellar/nss/3.116/include/nss -I/opt/homebrew/Cellar/nspr/4.37/include/nspr -I/opt/homebrew/C Llar/gpgmepp/2.0.0/include -1/opt/homebrew/Cellar/gpgme/2.0.1/include -1/opt/homebrew/Cellar/Libassuan/3.0.2/include -1/opt/homebrew/opt/libgpg error/include -I/opt/homebrew/Cellar/openjpeg/2.5.4/include/openjpeg-2.5 -I/opt/homebrew/opt/little-cms2/include -I/opt/homebrew/opt/libpng/inc ide/libpng16 -I/opt/homebrew/opt/libtiff/include -I/opt/homebrew/opt/zstd/include -I/opt/homebrew/Cellar/xz/5.8.1/include -I/opt/homebrew/opt/j eg-turbo/include -I/Users/carmine/-pyenv/versions/3.12.9/include/python3.12 -fvisibility=hidden -fvisibility-inlines-hidden -fdiagnostics-color always -DNDEBUG -Wall -Winvalid-pch -std=c++11 -03 MD -MQ src/cpp/image.cpython-312-darwin.so.p/image.cpp.o MF src/cpp/image.cpython-312-daru 1.so.p/image.cpp.o.d=o src/cpp/image.cpython-312-darwin.so.p/image.cpp.o=c ../src/cpp/image.cpp ../src/cpp/image.cpp:32:11: warning: variable 'img_data' set but not used I-Wunused-but-set-variable] 32 char *img_data = img. data (); In file included from ../src/cpp/image.cpp:20: • / subprojects/pybind11-2.10.3/include/pybind11/pybind11.h:218:13: error: static assertion failed due to requirement 'expected_num_args<py ind11:: name, pybind11:: is_method, pybind11: sibling, pybind11: arg_v>(sizeof... (Args), argument_ loader<const poppler:: image *>: args_pos >= 0, gument_loader<const poppler:: image *>::has_kwargs)': The number of argument annotations does not match the number of function arguments expected_num_args<Extra...›( 219 sizeof... (Args), cast_in::args_pos >= 0, cast_in::has_kwargs),