talkingwallace / ChatGPT-Paper-Reader

This repo offers a simple interface that helps you to read&summerize research papers in pdf format. You can ask some questions after reading. This interface is developed based on openai API and using GPT-3.5-turbo model.
739 stars 110 forks source link

HOCR Converter, open_filename, FileOrName, AnyIO doesn't exist in the pdfminer library #25

Closed junkim012 closed 1 year ago

junkim012 commented 1 year ago

Python version: Python 3.9.7

pdfminer version: pdfminer==20191125 from the repo's requirements.txt

Problem:

After installing all dependencies and running python example.py, there are functions in pdfminer that don't exist in the installed library.

Error Message:

ImportError: cannot import name 'HOCRConverter' from 'pdfminer.converter' (/Users/junkim/Development/projects/ai/ChatGPT-Paper-Reader/pdf-gpt/lib/python3.9/site-packages/pdfminer/converter.py)

After commenting out the HOCRConverter from from .converter import ( XMLConverter, HTMLConverter, TextConverter, PDFPageAggregator, HOCRConverter, ),

from .utils import open_filename, FileOrName, AnyIO also isn't able to import the three functions open_filename, FileOrName, and AnyIO.

Would love to figure out what's going wrong and be able to check out the program!

junkim012 commented 1 year ago

Fixed:

Remove the pdfminer==20191125 line from requirements.txt. You should only install pdfminer.six==20221105, and not together with the pdfminer==20191125 for the pdfminer imports to resolve.

Source: https://github.com/pdfminer/pdfminer.six/issues/570#issuecomment-1219808627

The solution worked for me!