我poppler
从https://github.com/oschwartz10612/poppler-windows/releases/tag/v21.03.0下载并尝试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, executable, preexec_fn, close_fds,
855 pass_fds, cwd, env,
C:\Python38\lib\subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_start_new_session)
1306 try:
-> 1307 hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
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, userpw, use_cropbox, strict, transparent, single_file, output_file, poppler_path, 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, userpw, 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, userpw, poppler_path, rawdates, 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?