Can't create pdf using python PDFKIT Error : “ No wkhtmltopdf executable found:”

前端 未结 10 1936
灰色年华
灰色年华 2020-12-01 06:37

I tried installing pdfkit Python API in my windows 8 machine. I\'m getting issues related to path.

Traceback (most recent call last):
  File \"C:\\Python27\\         


        
10条回答
  •  抹茶落季
    2020-12-01 07:08

    When I tried all of the above methods, I was till facing Permission Error as I don't have the admin rights to my workstation. If that's the case for you too, then make sure when you install your wkhtmltopdf.exe. The destination folder for installation is in your python site-packages folder, or add the directory to sys.path. Normally it gets installed in Program files folder. I changed the installation directory and this works for me:

    import pdfkit
    pdfkit.from_url("http://google.com", "out.pdf")
    

提交回复
热议问题