我正在尝试在 Windows 7 和 Python 2.7 中使用 pypdfocr。
这是我在 cmd 中尝试 pypdfocr 时收到的错误消息:
C:\Users\chamar.stu>pypdfocr F:\test2.pdf Starting conversion of F:\test2.pdf 'pdfimages' is not recognized as an internal or external command, operable program or batch file. WARNING: Could not execute pdfimages to calculate DPI (try installing xpdf or po ppler?), so defaulting to 300dpi Traceback (most recent call last): File "c:\users\chamar.stu\appdata\local\continuum\anaconda2\lib\runpy.py", line 174, in _run_module_as_main ... .... ....
pypdfocr\pypdfocr_tesseract.py", line 98, in _is_version_uptodate ver = [int(x) for x in ver_str.split('.')] ValueError: invalid literal for int() with base 10: '00alpha'
我似乎缺少 Poppler 或 XPDF 但我确实通过 PyGoObject 安装了 Poppler按照建议here .我还按照建议在我的环境路径中链接了 xpdf here .
有什么建议可以让我摆脱这个小烂摊子吗?
请您参考如下方法:
pypdfocr 脚本可能正在使用 子进程调用 模块。pdfimages 程序(poppler 实用程序 之一,而不是库)
我无法轻易辨别您提到的 URI 中是否提供了实用程序。
如果没有,您可以为实用程序找到预构建的 ms-windows 可执行文件,例如here .
确保 poppler 实用程序的安装位置在您的 PATH 中,以便 pypdfocr 可以找到它。
