OSError: No wkhtmltopdf executable found: "b''" If this file exists please check that this process can read it or you can pass path to it manually in method call, check README. Otherwise please install wkhtmltopdf - https
这个错误通常是由于缺少 wkhtmltopdf 或者路径错误导致的。如果你已经安装了 wkhtmltopdf,你可以尝试使用 --path
指定 wkhtmltopdf 执行文件的路径,例如:
from pdfkit import PDFKit
pdfkit = PDFKit(html, 'string')
pdfkit.to_pdf('/path/to/output.pdf', options={'--path': '/path/to/wkhtmltopdf'})
如果你没有安装 wkhtmltopdf,请根据你的操作系统安装 wkhtmltopdf。可以从 wkhtmltopdf 的官方网站下载安装程序:https://wkhtmltopdf.org/downloads.html。安装完成后,将 wkhtmltopdf 的路径添加到系统环境变量中。
OSError: No wkhtmltopdf executable found: "b''" If this file exists please check that this process can read it or you can pass path to it manually in method call, check README. Otherwise please install wkhtmltopdf - https://github.com/JazzCore/python-pdfkit/wiki/Installing-wkhtmltopdf
这个错误通常是由于找不到wkhtmltopdf
可执行文件所致。请按照以下步骤解决此问题:
首先,确保你已经安装了
wkhtmltopdf
工具。你可以从https://wkhtmltopdf.org/downloads.html下载适用于你操作系统的版本,并按照说明进行安装。一旦
wkhtmltopdf
安装完成,你需要指定其可执行文件的路径。可以通过两种方式来实现:a. 在代码中指定路径:
pdfkit.from_string(content, 'output.pdf', configuration=pdfkit.configuration(wkhtmltopdf='/path/to/wkhtmltopdf'))
将
/path/to/wkhtmltopdf
替换为你实际安装的wkhtmltopdf
可执行文件的路径。b. 将
wkhtmltopdf
可执行文件的路径添加到系统环境变量中,这样就可以在代码中直接使用pdfkit.from_string(content, 'output.pdf')
。
注意:在某些操作系统中,可能需要使用完整的可执行文件路径,例如/usr/local/bin/wkhtmltopdf
。
如果你仍然遇到问题,请确保你已经正确安装了wkhtmltopdf
并指定了正确的可执行文件路径。如果问题仍然存在,请向我提供更多信息,我将尽力帮助你解决问题。
OSError: No wkhtmltopdf executable found: "E:\wkhtnltopdf\wkhtmltopdf\bin\wkhtmltopdf.exe"
根据引用,该错误是由于找不到wkhtmltopdf可执行文件导致的。提示中建议检查该文件是否存在以及当前进程是否可读取该文件。另外,你可以在方法调用中手动传递该文件的路径。你也可以参考引用和中的代码示例来设置wkhtmltopdf的路径。你可以检查一下你的wkhtmltopdf文件是否存在,并确保路径正确。如果不存在,你可以安装wkhtmltopdf。123
引用[.reference_title]
- 1 2 raise IOError(‘No wkhtmltopdf executable found: “%s“\n‘OSError: No wkhtmltopdf executable found:...[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2
allinsert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] - 3 Pdfkit OSError: No wkhtmltopdf executable found[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2
allinsert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
相关推荐
















