biswajitsc / TopcoderToPdf

A crawler to crawl topcoder problems and compile into a single PDF file.
8 stars 3 forks source link

ImportError: No module named pdfkit #2

Open govi20 opened 8 years ago

govi20 commented 8 years ago

I am getting this error, while generating the pdf file.

File "topcoderGenPdf.py", line 1, in <module>
    import pdfkit
ImportError: No module named pdfkit

It would be nice if we provide the link for downloading,installing the required libraries and connect them with the python program, I mean in terms of configurations like path variable etc.

biswajitsc commented 8 years ago

Installing pdfkit using pip should work. Also I have updated the readme after your comment. I was missing some points before. Let me know if there is any other problem.

govi20 commented 7 years ago

Tried after almost a year :-) Now getting this error.

Traceback (most recent call last): File "topcoderGenPdf.py", line 55, in pdfkit.from_file(open('./proc_htmls/{0}'.format(filename)), './PDFs/{0}.pdf'.format(filename), options = options) File "/usr/local/lib/python2.7/dist-packages/pdfkit/api.py", line 46, in from_file return r.to_pdf(output_path) File "/usr/local/lib/python2.7/dist-packages/pdfkit/pdfkit.py", line 119, in to_pdf raise IOError("wkhtmltopdf exited with non-zero code {0}. error:\n{1}".format(exit_code, stderr.decode("utf-8"))) IOError: wkhtmltopdf exited with non-zero code 1. error: Unknown long argument --cache-dir

Would be nice if you mention dependency versions too.

yishaistreamline commented 3 years ago

@biswajitsc @govi20 So sorry to bother you! I was hoping you could point me to someone who can answer this question: https://stackoverflow.com/questions/69366504/generate-table-of-contents-with-pdfkit-for-python Thank you!