如何安装 python-poppler

问题描述

我从 https://github.com/oschwartz10612/poppler-windows/releases/tag/v21.03.0 下载了 poppler 并尝试在命令提示符中使用 pip install python-poppler 安装它。它捕获了错误

  Running setup.py clean for python-poppler
Failed to build python-poppler
Installing collected packages: python-poppler
    Running setup.py install for python-poppler ... error

我已经解压了 python poppler zip 文件并将其放在当前路径中,但是单击文件夹并没有安装它,我该如何安装它?文件夹如下所示:

enter image description here


编辑:

我试过跑步

import pdf2image
from pdf2image import convert_from_path

它发现了错误

---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
C:\python38\lib\site-packages\pdf2image\pdf2image.py in pdfinfo_from_path(pdf_path,userpw,poppler_path,rawdates,timeout)
    457             env["LD_LIBRARY_PATH"] = poppler_path + ":" + env.get("LD_LIBRARY_PATH","")
--> 458         proc = Popen(command,env=env,stdout=PIPE,stderr=PIPE)
    459 

C:\python38\lib\subprocess.py in __init__(self,args,bufsize,executable,stdin,stdout,stderr,preexec_fn,close_fds,shell,cwd,env,universal_newlines,startupinfo,creationflags,restore_signals,start_new_session,pass_fds,encoding,errors,text)
    853 
--> 854             self._execute_child(args,855                                 pass_fds,C:\python38\lib\subprocess.py in _execute_child(self,p2cread,p2cwrite,c2pread,c2pwrite,errread,errwrite,unused_restore_signals,unused_start_new_session)
   1306             try:
-> 1307                 hp,ht,pid,tid = _winapi.CreateProcess(executable,1308                                          # no special security

FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception,another exception occurred:

PDFInfonotinstalledError                  Traceback (most recent call last)
<ipython-input-16-6d2671d2842e> in <module>
      6 
      7 pdfs = r"C:\Users\Uset\Desktop\pdf_test_file.pdf"
----> 8 pages = convert_from_path(pdfs,350)
      9 
     10 i = 1

C:\python38\lib\site-packages\pdf2image\pdf2image.py in convert_from_path(pdf_path,dpi,output_folder,first_page,last_page,fmt,jpegopt,thread_count,use_cropBox,strict,transparent,single_file,output_file,grayscale,size,paths_only,use_pdftocairo,timeout,hide_annotations)
     96         poppler_path = poppler_path.as_posix()
     97 
---> 98     page_count = pdfinfo_from_path(pdf_path,poppler_path=poppler_path)["Pages"]
     99 
    100     # We start by getting the output format,the buffer processing function and if we need pdftocairo

C:\python38\lib\site-packages\pdf2image\pdf2image.py in pdfinfo_from_path(pdf_path,timeout)
    482 
    483     except OSError:
--> 484         raise PDFInfonotinstalledError(
    485             "Unable to get page count. Is poppler installed and in PATH?"
    486         )

PDFInfonotinstalledError: Unable to get page count. Is poppler installed and in PATH?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...