带有pdfkit的wkhtmltopdf无法在VPS服务器

时间:2018-03-10 05:46:55

标签: python django ubuntu wkhtmltopdf pdfkit

我已经安装了wkhtmltopdf和xvfb。它在服务器上使用命令行以及在django / python shell中工作正常,但是使用uwsgi + nginx它会抛出以下错误

wkhtmltopdf exited with non-zero code 127. error:
/usr/bin/xvfb-run: 25: /usr/bin/xvfb-run: awk: not found
/usr/bin/xvfb-run: 97: /usr/bin/xvfb-run: getopt: not found

Django Version: 1.11.6
Exception Type: OSError
Exception Value:    
wkhtmltopdf exited with non-zero code 127. error:
/usr/bin/xvfb-run: 25: /usr/bin/xvfb-run: awk: not found
/usr/bin/xvfb-run: 97: /usr/bin/xvfb-run: getopt: not found
Exception Location: /home/dev/env3/lib/python3.5/site-packages/pdfkit/pdfkit.py in to_pdf, line 159
Python Executable:  /usr/bin/uwsgi-core
Python Version: 3.5.2

在终端

which awk
/usr/bin/awk
which getopt
/usr/bin/getopt

感谢。

0 个答案:

没有答案