5

Hi I have looked through all similar posts and implemented the suggestions but still no luck.

Running Python, PDFKIT, Windows 7, Google App Engine.

I get this error when trying to run the program

IOError: No wkhtmltopdf executable found: "C:/Users/nb198011/Documents/Shillan/Personal/Installs/wkhtmltopdf/bin/wkhtmltopdf.exe"

If this file exists please check that this process can read it. Otherwise please install wkhtmltopdf - https://github.com/JazzCore/python-pdfkit/wiki/Installing-wkhtmltopdf

I have confirmed the file is indeed in that location using the "where" command and I can execute the wkhtmltopdf program from the command line.

I import PDFKIT into my program by holding it in the same folder as my project and wkhtmltopdf is installed into the folder specified in the error message

Any new suggestions would be greatly appreciated

4
  • "I can execute the wkhtmltopdf program from the command line" - but can the user that is running the program? If it's not you. Try granting full access to everyone everywhere to the file and try that, it should rule out permission issues. Commented Nov 25, 2014 at 12:52
  • Okay managed to sort it out. Not sure what the problem was though. I uninstalled PDFkit from site-packages and removed all enviro paths to it. Then downloaded a version and copied it to my project folder as before and it worked. Commented Nov 27, 2014 at 15:00
  • 1
    Cool! You can add that as an answer to this question to help future answer seekers :) Commented Nov 28, 2014 at 8:29
  • Oh hey the solution didn't work for me. I'm on Windows 7, running python 3 from anaconda. It seems like it might be a windows environment variable issue because after fiddling with this solution I get different errors with the filepath to the executable. Commented Jan 8, 2016 at 21:08

2 Answers 2

7

I have spent some time ti figure out the process to converting html pages to pdf on mac os. Here are the steps,

  1. install pdfkit from pip pip install pdfkit
  2. download and install wkhtmltopdf from link
  3. Then setup is done, My python file is

    import pdfkit config = pdfkit.configuration(wkhtmltopdf="path_to_exe") pdfkit.from_url('http://google.com', 'out.pdf',configuration = config) pdfkit.from_file('test.html', 'out.pdf',configuration = config) pdfkit.from_string('Hello!', 'out.pdf',configuration = config) 

And it worked perfectly.

Sign up to request clarification or add additional context in comments.

Comments

1

Okay managed to sort it out. Not sure what the problem was though. I uninstalled PDFkit from site-packages and removed all enviro paths to it. Then downloaded a version and copied it to my project folder as before and it worked. – Shillz

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.