小编Aru*_*ash的帖子

无法使用python PDFKIT创建pdf错误:"找不到wkhtmltopdf可执行文件:"

我尝试在我的Windows 8机器上安装pdfkit Python API.我遇到了与路径有关的问题.

Traceback (most recent call last):
  File "C:\Python27\pdfcre", line 13, in <module>
    pdfkit.from_url('http://google.com', 'out.pdf')
  File "C:\Python27\lib\site-packages\pdfkit\api.py", line 22, in from_url
    configuration=configuration)
  File "C:\Python27\lib\site-packages\pdfkit\pdfkit.py", line 38, in __init__
    self.configuration = (Configuration() if configuration is None
  File "C:\Python27\lib\site-packages\pdfkit\configuration.py", line 27, in __init__
    'https://github.com/JazzCore/python-pdfkit/wiki/Installing-wkhtmltopdf' % self.wkhtmltopdf)
IOError: No wkhtmltopdf executable found: ""
If this file exists please check that this process can read it. Otherwise please install wkhtmltopdf - https://github.com/JazzCore/python-pdfkit/wiki/Installing-wkhtmltopdf
Run Code Online (Sandbox Code Playgroud)

是否有人在Windows机器上安装了Python PDFKIt?如何解决此错误.

我的示例代码:

import pdfkit
import os
config = pdfkit.configuration(wkhtmltopdf='C:\\Python27\\wkhtmltopdf\bin\\wkhtmltopdf.exe') …
Run Code Online (Sandbox Code Playgroud)

python api pdfkit python-2.7

20
推荐指数
4
解决办法
3万
查看次数

标签 统计

api ×1

pdfkit ×1

python ×1

python-2.7 ×1