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.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

junkim012 opened this issue · comments

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!

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: pdfminer/pdfminer.six#570 (comment)

The solution worked for me!