IOError:wkhtmltopdf以非零代码127退出。错误:[空白]

时间:2016-04-19 12:35:41

标签: wkhtmltopdf pdfkit

我一直在尝试使用pdfkit/wkhtmltopdf,但是当我使用它时,我收到以下错误:

"IOError: wkhtmltopdf exited with non-zero **code** **127**. error:"

File "/usr/local/lib/python2.7/dist-packages/pdfkit/pdfkit.py", line 119, in to_pdf
    raise IOError("wkhtmltopdf exited with non-zero code {0}. error:\n{1}".format(exit_code, stderr.decode("utf-8")))
IOError: wkhtmltopdf exited with non-zero code 127. error:

1 个答案:

答案 0 :(得分:2)

尝试像这样手动运行wkhtmltopdf:

wget google.com wkhtmltopdf index.html out.pdf

就我而言,我没有安装wkhtmltopdf。我不得不这样做:

sudo apt-get install wkhtmltopdf