ocrmypdf / OCRmyPDF

OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched
http://ocrmypdf.readthedocs.io/
Mozilla Public License 2.0
14.13k stars 1.02k forks source link

[Bug]: No module named 'lxml' #1197

Closed tcurdt closed 11 months ago

tcurdt commented 11 months ago

What were you trying to do?

$ ocrmypdf -l deu+eng -s "$FILE" "$INBOX/$BASENAME"

I suspect it's just a library that is missing. But since it's installed via homebrew it might be more than just a simple install.

Where are you installing from?

Homebrew

What operating system are you working on?

macOS

Relevant log output

$ ocrmypdf -l deu+eng -s "$FILE" "$INBOX/$BASENAME"
Traceback (most recent call last):
  File "/opt/homebrew/bin/ocrmypdf", line 5, in <module>
    from ocrmypdf.__main__ import run
  File "/opt/homebrew/Cellar/ocrmypdf/15.4.3/libexec/lib/python3.12/site-packages/ocrmypdf/__init__.py", line 10, in <module>
    from ocrmypdf import helpers, hocrtransform, pdfa, pdfinfo
  File "/opt/homebrew/Cellar/ocrmypdf/15.4.3/libexec/lib/python3.12/site-packages/ocrmypdf/helpers.py", line 28, in <module>
    import pikepdf
  File "/opt/homebrew/Cellar/ocrmypdf/15.4.3/libexec/lib/python3.12/site-packages/pikepdf/__init__.py", line 55, in <module>
    from .models import (
  File "/opt/homebrew/Cellar/ocrmypdf/15.4.3/libexec/lib/python3.12/site-packages/pikepdf/models/__init__.py", line 18, in <module>
    from .metadata import PdfMetadata
  File "/opt/homebrew/Cellar/ocrmypdf/15.4.3/libexec/lib/python3.12/site-packages/pikepdf/models/metadata.py", line 18, in <module>
    from lxml import etree
ModuleNotFoundError: No module named 'lxml'
jbarlow83 commented 11 months ago

Homebrew will need to fix this.