curiousily/Get-Things-Done-with-Prompt-Engineering-and-LangChain

PDFInfoNotInstalledError: Unable to get page count. Is poppler installed and in PATH?

hherpa opened this issue · 0 comments

I tried to run your google collab notepad: "06.private-gpt4all-qa-pdf.ipynb". I didn't edit your code, but just started the cells step by step. In this section of the code:

images = convert_from_path("ms-financial-statement.pdf", dpi=88)
len(images)

I had this kind of error:

---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
[/usr/local/lib/python3.10/dist-packages/pdf2image/pdf2image.py](https://localhost:8080/#) in pdfinfo_from_path(pdf_path, userpw, ownerpw, poppler_path, rawdates, timeout)
    567             env["LD_LIBRARY_PATH"] = poppler_path + ":" + env.get("LD_LIBRARY_PATH", "")
--> 568         proc = Popen(command, env=env, stdout=PIPE, stderr=PIPE)
    569 

4 frames
FileNotFoundError: [Errno 2] No such file or directory: 'pdfinfo'

During handling of the above exception, another exception occurred:

PDFInfoNotInstalledError                  Traceback (most recent call last)
[/usr/local/lib/python3.10/dist-packages/pdf2image/pdf2image.py](https://localhost:8080/#) in pdfinfo_from_path(pdf_path, userpw, ownerpw, poppler_path, rawdates, timeout)
    592 
    593     except OSError:
--> 594         raise PDFInfoNotInstalledError(
    595             "Unable to get page count. Is poppler installed and in PATH?"
    596         )

PDFInfoNotInstalledError: Unable to get page count. Is poppler installed and in PATH?

here is a screenshot:
image