dfd-tud / deda

Home Page:https://dfd.inf.tu-dresden.de

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Kracken256 opened this issue · comments

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.

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

pip3 install -U deda