Find answers from the community

Updated last year

I am trying to load pdf tables and am

At a glance

The community member is trying to load PDF tables using PDFTableReader() from the llama-hub library, but is encountering an error related to the deprecated PdfFileReader class in the PyPDF2 library. The community member is wondering if they should replace PDFTableReader() with PyPDF to properly read the tables.

In the comments, other community members suggest that the issue might be related to the Camelot library, which is used by the loader. They recommend checking if Camelot is properly installed and upgrading it if necessary. One community member mentions that the issue works fine on their machine, while another suggests starting with a fresh virtual environment if the problem persists.

There is no explicitly marked answer in the comments.

Useful resources
I am trying to load pdf tables , and am using PDFTableReader() according to llama-hub. But am getting this error , Should I replace PDFTableReader with PyPDF? Will it read the tables properly?
Plain Text
1973 def __init__(self, *args: Any, **kwargs: Any) -> None:
-> 1974     deprecation_with_replacement("PdfFileReader", "PdfReader", "3.0.0")
   1975     if "strict" not in kwargs and len(args) < 2:
   1976         kwargs["strict"] = True  # maintain the default

File ~/anaconda3/lib/python3.10/site-packages/PyPDF2/_utils.py:369, in deprecation_with_replacement(old_name, new_name, removed_in)
    363 def deprecation_with_replacement(
    364     old_name: str, new_name: str, removed_in: str = "3.0.0"
    365 ) -> None:
    366     """
    367     Raise an exception that a feature was already removed, but has a replacement.
    368     """
--> 369     deprecation(DEPR_MSG_HAPPENED.format(old_name, removed_in, new_name))

File ~/anaconda3/lib/python3.10/site-packages/PyPDF2/_utils.py:351, in deprecation(msg)
    350 def deprecation(msg: str) -> None:
--> 351     raise DeprecationError(msg)

DeprecationError: PdfFileReader is deprecated and was removed in PyPDF2 3.0.0. Use PdfReader instead.
L
M
7 comments
i can't do anything without you updating the package, right? can you check please if it generates a similar error on your side?
It works fine on my machine
maybe double check you installed camelot properly
https://camelot-py.readthedocs.io/en/master/user/install-deps.html

And if you aren't using download_loader, you also have to
Plain Text
pip install --upgrade camelot-py opencv-python ghostscript
I would start with a fresh venv if you have troubles after that
thank you , will do!
Add a reply
Sign up and join the conversation on Discord