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

ImportError: cannot import name 'pdf' from 'PyPDF2' #25

Closed
Kracken256 opened this issue Aug 11, 2022 · 2 comments
Closed

ImportError: cannot import name 'pdf' from 'PyPDF2' #25

Kracken256 opened this issue Aug 11, 2022 · 2 comments

Comments

@Kracken256
Copy link

Kracken256 commented Aug 11, 2022

wesjo@ubuntu:~$ deda_gui
/home/wesjo/.local/lib/python3.8/site-packages/numpy/core/getlimits.py:500: UserWarning: The value of the smallest subnormal for <class 'numpy.float64'> type is zero.
  setattr(self, word, getattr(machar, word).flat[0])
/home/wesjo/.local/lib/python3.8/site-packages/numpy/core/getlimits.py:89: UserWarning: The value of the smallest subnormal for <class 'numpy.float64'> type is zero.
  return self._float_to_str(self.smallest_subnormal)
/home/wesjo/.local/lib/python3.8/site-packages/numpy/core/getlimits.py:500: UserWarning: The value of the smallest subnormal for <class 'numpy.float32'> type is zero.
  setattr(self, word, getattr(machar, word).flat[0])
/home/wesjo/.local/lib/python3.8/site-packages/numpy/core/getlimits.py:89: UserWarning: The value of the smallest subnormal for <class 'numpy.float32'> type is zero.
  return self._float_to_str(self.smallest_subnormal)
Traceback (most recent call last):
  File "/home/wesjo/.local/bin/deda_gui", line 5, in <module>
    from deda_gui.deda_gui import main
  File "/home/wesjo/.local/lib/python3.8/site-packages/deda_gui/deda_gui.py", line 18, in <module>
    from libdeda.pattern_handler import TDM, Pattern4
  File "/home/wesjo/.local/lib/python3.8/site-packages/libdeda/__init__.py", line 1, in <module>
    from . import print_parser, privacy, extract_yd, pattern_handler
  File "/home/wesjo/.local/lib/python3.8/site-packages/libdeda/privacy.py", line 23, in <module>
    import libdeda.pypdf2patch
  File "/home/wesjo/.local/lib/python3.8/site-packages/libdeda/pypdf2patch.py", line 7, in <module>
    from PyPDF2 import pdf
ImportError: cannot import name 'pdf' from 'PyPDF2' (/home/wesjo/.local/lib/python3.8/site-packages/PyPDF2/__init__.py)

======================================
This was on a fresh install of ubuntu 20.04 with no custom config.
Linux ubuntu 5.13.0-52-generic #59~20.04.1-Ubuntu SMP Thu Jun 16 21:21:28 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Also tried first on kali linux.

@timojuez
Copy link
Collaborator

Thanks for the report. It seems that PyPDF2 changed their API radically. As a workaround this should solve it for now:
pip3 install pypdf2==1.28.5

@timojuez timojuez pinned this issue Aug 12, 2022
@timojuez timojuez changed the title Unable to run any scripts. ImportError: cannot import name 'pdf' from 'PyPDF2' Aug 12, 2022
@timojuez
Copy link
Collaborator

pip3 install -U deda

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

No branches or pull requests

2 participants