wkhtmltopdf Error "No such file or directory" (Django)

I encountered this problem after a linux upgrade. I found the solution at this link: https://github.com/incuna/django-wkhtmltopdf/issues/75

In my case, the basic solution is find out where wkhtmltopdf is stored using which:

$ which wkhtmltopdf
/usr/local/bin/wkhtmltopdf

Then add the following line to settings.py:

WKHTMLTOPDF_CMD = '/usr/local/bin/wkhtmltopdf'

(i.e. the location returned by which)

N.B. If which wkhtmltopdf returns blank, you probably haven’t properly installed wkhtmltopdf. You can do so from https://wkhtmltopdf.org/downloads.html


There is another solution: on top of your pip install, just install the relevant version of wkhtmltopdf binary from here: http://wkhtmltopdf.org/downloads.html. In my case, this solved the problem.