Skip to content

[Bug]: ModuleNotFoundError: No module named 'img2pdf' #1654

@Calorion

Description

@Calorion

What were you trying to do?

Follow the instructions at internetarchive/archive-pdf-tools@e1b83f6 to create a hOCR file so I can compress a PDF with archive-pdf-tools.

(I’m running from Macports, not Homebrew)

Where are you installing/running from?

Homebrew

OCRmyPDF version

Traceback (most recent call last): File "/opt/local/bin/ocrmypdf", line 5, in from ocrmypdf.main import run File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/ocrmypdf/init.py", line 10, in from ocrmypdf import helpers, hocrtransform, pdfa, pdfinfo File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/ocrmypdf/helpers.py", line 26, in import img2pdf ModuleNotFoundError: No module named 'img2pdf'

What operating system are you working on?

macOS

Operating system details and version

12.7.6

Simple sanity checks

  • Operating system is currently supported by its vendor (not end of life)
  • Python version is compatible with OCRmyPDF
  • This issue is not about a specific input file

Relevant log output

Traceback (most recent call last):   File "/opt/local/bin/ocrmypdf", line 5, in <module>     from ocrmypdf.__main__ import run   File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/ocrmypdf/__init__.py", line 10, in <module>     from ocrmypdf import helpers, hocrtransform, pdfa, pdfinfo   File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/ocrmypdf/helpers.py", line 26, in <module>     import img2pdf ModuleNotFoundError: No module named 'img2pdf'

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions