我已经安装了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
感谢。