我一直在尝试使用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:
答案 0 :(得分:2)
尝试像这样手动运行wkhtmltopdf:
wget google.com
wkhtmltopdf index.html out.pdf
就我而言,我没有安装wkhtmltopdf。我不得不这样做:
sudo apt-get install wkhtmltopdf