maxpmaxp / pdfreader

Python API for PDF documents
MIT License
117 stars 27 forks source link

No module named 'pkg_resources' #113

Closed zacharysyoung closed 7 months ago

zacharysyoung commented 8 months ago

Wanting to try the CMap tutorial I installed latest with pip3 install pdfreader, and tried the first code example:

from pdfreader import PDFDocument

fd = open("input.pdf", "rb")
doc = PDFDocument(fd)

which failed with:

Traceback (most recent call last):
  File "main.py", line 1, in <module>
    from pdfreader import PDFDocument
  File "~/Library/Python/3.12/lib/python/site-packages/pdfreader/__init__.py", line 3, in <module>
    from .viewer import SimplePDFViewer, PageDoesNotExist
  File "~/Library/Python/3.12/lib/python/site-packages/pdfreader/viewer/__init__.py", line 5, in <module>
    from .simple import SimplePDFViewer
  File "~/Library/Python/3.12/lib/python/site-packages/pdfreader/viewer/simple.py", line 6, in <module>
    from ..codecs.decoder import Decoder, default_decoder
  File "~/Library/Python/3.12/lib/python/site-packages/pdfreader/codecs/decoder.py", line 3, in <module>
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'