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
PdfFileReader is deprecated and was removed in PyPDF2 3.0.0 #339
Comments
As a workaround, I've added this line in my
|
Hey @szeswee, Gone with the steps, created a virtual environment through terminal, and executed the script in the IDE, as well as in colab, giving the same error. |
Hey @szeswee I also tried on both platforms(see screenshots) like @KshitizPandya and have the issue still. Does it work for you? Can you explain it more in detail? |
As a side-note: |
We are hitting this issue now, any workaround fix? |
@vinayak-mehta if you want, I'm available to submit a PR to fix this issue. |
Thank you for the workaround fix |
Hey @saidakyuz , I did a bit of work around and now my camelot is working fine. Am mentioning the steps below if you want to refer.
Environment packages: Note: It might sometimes create error showing ghostscript is not installed. You can explicitly install it from: https://ghostscript.com/releases/gsdnld.html Then the issue should be resolved. Hope it helps. |
@KshitizPandya Please replace |
Thanks for the correction @MartinThoma |
Another possible way is to downgrade installed version of pip install --upgrade PyPDF2==2.12.1 |
Im so close to getting my program finished, when i run in pycharm the code runs fine when i run the exe i get the the suggested workarounds arent working for me, probably because this is my first program. |
I tried this and also downgraded to PyPDF2.0, i get the same result, the deprecation error. I'm sure I'm missing something dumb. |
@RhacklefordGPT most likely you downgraded it in the wrong environment. So you have two places where PyPDF2 is installed. You need to ensure to downgrade it in the correct one. For example, you might need To verify, you can add the following before you import camelot:
|
Looks like that did the trick. |
i have already do that but i get other error |
Hey @au3m, STEPS FOR REFERENCE:
After this your program should run fine without giving the ghostscript related error. |
@KshitizPandya |
I think the problem is based on a missed migration considering the naming adjustments within PyPDF2/pypdf - see the following doc: https://pypdf2.readthedocs.io/en/stable/user/migration-1-to-2.html Following the The Deprecation Process of PyPDF2/pypdf they are not longer tolerated. I replaced the handlers.py-file with the file from the PR below and the cli is working again for me. |
If anyone trying to do this on colab then run the following steps: !pip install ghostscript
!pip install camelot-py[cv]
!pip install excalibur-py
!apt install ghostscript python3-tk And after that check if installed: from ctypes.util import find_library
# It will display `libgs.so.9` if installed or will print `None` if not
print(find_library("gs")) If still doesn't work: !excalibur initdb Source: here |
Thanks! Help me a lot. |
pip install --upgrade PyPDF2==2.12.1 works |
I set all the libs exact same version as yours, yet error remains... |
Describe the bug
Version 3.0.0 of
PyPDF2
was just released today (23 Dec 2022), which includes a breaking change for removingPdfFileReader
(see changelog). As a result, all new installs and usage ofcamelot-py
will raise the following exception:Steps to reproduce the bug
camelot-py
:Expected behavior
The code above should execute without any exceptions.
Environment
The text was updated successfully, but these errors were encountered: