pdf2image 路径中的 Poppler [英] Poppler in path for pdf2image

查看:81
本文介绍了pdf2image 路径中的 Poppler的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 pdf2image,看来我需要一种叫做 propeller 的东西:

I'm trying to use pdf2image and it seems I need something called propeller :

(sum_env) C:\Users\antoi\Documents\Programming\projects\summarizer>python ocr.py -i fr13_idf.pdf
Traceback (most recent call last):
  File "c:\Users\antoi\Documents\Programming\projects\summarizer\sum_env\lib\site-packages\pdf2image\pdf2image.py", line 165, in __page_count
    proc = Popen(["pdfinfo", pdf_path], stdout=PIPE, stderr=PIPE)
  File "C:\Python37\lib\subprocess.py", line 769, in __init__
    restore_signals, start_new_session)
  File "C:\Python37\lib\subprocess.py", line 1172, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "ocr.py", line 53, in <module>
    pdfspliterimager(image_path)
  File "ocr.py", line 32, in pdfspliterimager
    pages = convert_from_path("document-page%s.pdf" % i, 500)
  File "c:\Users\antoi\Documents\Programming\projects\summarizer\sum_env\lib\site-packages\pdf2image\pdf2image.py", line 30, in convert_from_path
    page_count = __page_count(pdf_path, userpw)
  File "c:\Users\antoi\Documents\Programming\projects\summarizer\sum_env\lib\site-packages\pdf2image\pdf2image.py", line 169, in __page_count
    raise Exception('Unable to get page count. Is poppler installed and in PATH?')
Exception: Unable to get page count. Is poppler installed and in PATH?

我试过这个链接,但下载的东西没有解决我的问题.

I tried this link but it the thing to download didn't solved my problem.

推荐答案

pdf2image 只是对 poppler 的封装(不是螺旋桨!),要使用该模块,您需要在您的机器和路径中安装 poppler-utils.

pdf2image is only a wrapper around poppler (not propeller!), to use the module you need to have poppler-utils installed on your machine and in your path.

该过程在如何安装"部分的项目自述文件中链接.

The procedure is linked in the project's README in the "How to install" section.

这篇关于pdf2image 路径中的 Poppler的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆