如何解决如何安装 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 文件并将其放在当前路径中,但是单击文件夹并没有安装它,我该如何安装它?文件夹如下所示:
编辑:
我试过跑步
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 举报,一经查实,本站将立刻删除。