lzjun567 / python_scripts

一些python相关的演示代码
Apache License 2.0
717 stars 528 forks source link

OSError: wkhtmltopdf exited with non-zero code -6. error: #17

Open xpguan opened 7 years ago

xpguan commented 7 years ago

Traceback (most recent call last): File "crawler.py", line 165, in crawler.run() File "crawler.py", line 99, in run pdfkit.from_file(htmls, self.name + ".pdf", options=options) File "/usr/local/lib/python3.4/dist-packages/pdfkit/api.py", line 49, in from_file return r.to_pdf(output_path) File "/usr/local/lib/python3.4/dist-packages/pdfkit/pdfkit.py", line 159, in to_pdf raise IOError("wkhtmltopdf exited with non-zero code {0}. error:\n{1}".format(exit_code, stderr)) OSError: wkhtmltopdf exited with non-zero code -6. error: The switch --outline-depth, is not support using unpatched qt, and will be ignored.QXcbConnection: Could not connect to display

xpguan commented 7 years ago

换了wkhtmltopdf的版本之后就好了!

rockyfire commented 7 years ago

https://stackoverflow.com/questions/18758589/wkhtmltopdf-installation-error-on-ubuntu

进行到第三步的时候 连不上外网的ip就是下载不了

HowinLoo commented 6 years ago

@xpguan 请问换哪个版本的?

dmitryTsatsarin commented 6 years ago

install 0.12.4 version from official web-site Works for me.

d3prof3t commented 6 years ago

I'm getting an exit code of -9 with 0.12.4. wkhtmltopdf exited with non-zero code -9

Can someone please suggest how to fix this issue.