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

added library for parsing PDFs #64

Merged
merged 1 commit into from
May 14, 2023
Merged

Conversation

ghost
Copy link

@ghost ghost commented May 12, 2023

pdfminer.six==20221105

pdfminer.six==20221105
@imartinez
Copy link
Collaborator

Why is that dependency needed @FluffyDietEngine ?

@Polpetta
Copy link

Polpetta commented May 12, 2023

I initialized the project using a virtual environment, and after adding a couple of PDFs I run python ingest.py I got the following error:

python ingest.py               
Traceback (most recent call last):
  File "/home/user/git/privateGPT/venv/lib/python3.11/site-packages/langchain/document_loaders/pdf.py", line 194, in __init__
    from pdfminer.high_level import extract_text  # noqa:F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'pdfminer'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/git/privateGPT/ingest.py", line 35, in <module>
    main()
  File "/home/user/git/privateGPT/ingest.py", line 21, in main
    loader = PDFMinerLoader(os.path.join(root, file))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/git/privateGPT/venv/lib/python3.11/site-packages/langchain/document_loaders/pdf.py", line 196, in __init__
    raise ValueError(
ValueError: pdfminer package not found, please install it with `pip install pdfminer.six`

After adding the dependency suggested in this PR, python ingest.py works without problems

@ghost
Copy link
Author

ghost commented May 12, 2023

@imartinez When I tried to use PDFMinerLoader to parse a PDF, I got the error which @Polpetta has given. Hence the addition in requirement. Traceback for your reference.

python --version
Python 3.10.9
Traceback (most recent call last):
  File "/Users/santhoshsolomon/Projects/privateGPT/venv/lib/python3.10/site-packages/langchain/document_loaders/pdf.py", line 194, in __init__
    from pdfminer.high_level import extract_text  # noqa:F401
ModuleNotFoundError: No module named 'pdfminer'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/santhoshsolomon/Projects/privateGPT/ingest.py", line 36, in <module>
    main()
  File "/Users/santhoshsolomon/Projects/privateGPT/ingest.py", line 22, in main
    loader = PDFMinerLoader(os.path.join(root, file))
  File "/Users/santhoshsolomon/Projects/privateGPT/venv/lib/python3.10/site-packages/langchain/document_loaders/pdf.py", line 196, in __init__

PDF I am using is available as attachment.
8-Data-Modeling-Patterns-in-Redis.pdf

@imartinez imartinez merged commit 7612193 into zylon-ai:main May 14, 2023
This pull request was closed.
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

Successfully merging this pull request may close these issues.

3 participants