Problem: I've been attempting to use the Python library pdf2image, which I am aware requires the prior installation of poppler. Poppler is installed (via homebrew) and the package via pip.
However, when running convert_to_path(my_pdf) I get the following:
Traceback (most recent call last):
File "<ipython-input-9-ba107659b495>", line 1, in <module>
test_image = convert_from_path(testfile,
File "/Users/<myuser>/.pyenv/versions/3.8.0/lib/python3.8/site-packages/pdf2image/pdf2image.py", line 97, in convert_from_path
page_count = pdfinfo_from_path(pdf_path, userpw, poppler_path=poppler_path)["Pages"]
File "/Users/<myuser>/.pyenv/versions/3.8.0/lib/python3.8/site-packages/pdf2image/pdf2image.py", line 467, in pdfinfo_from_path
raise PDFInfoNotInstalledError(
PDFInfoNotInstalledError: Unable to get page count. Is poppler installed and in PATH?
My System: Mac, OC 10.15.7 Python (via Homebrew) version 3.8.0
which python
/Users/<myuser>/.pyenv/shims/python
which pip
/Users/<myuser>/.pyenv/shims/pip
What I've tried so far:
Poppler is installed via homebrew (brew install poppler) and pdf2image installed with pip3 install pdf2image
I've run brew cleanup too.
Attempted to force the poppler path in convert_to_path with the following,
pop_path = "/usr/local/Cellar/poppler/21.03.0_1"
convert_to_path(my_pdf_file,poppler_path = pop_path)
but still get the same error.
Had a decent look online and found many people with similar, yet not identical, problems. I feel like I must be doing something wrong, so any guidance would be great.