【问题标题】:Python pdfkit can't find wkhtmltopdf executablePython pdfkit 找不到 wkhtmltopdf 可执行文件
【发布时间】:2017-01-13 09:39:25
【问题描述】:

几个月前,我创建了一个将 URL 转换为 PDF 文件的小脚本,今天早上我尝试转换另一个链接,但我从 py 提示符收到此错误:

File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\pdfkit\api.py", line 24, in from_url
configuration=configuration, cover_first=cover_first)
File "C:\Python27\lib\site-packages\pdfkit\pdfkit.py", line 42, in __init__
self.configuration = (Configuration() if configuration is None
File "C:\Python27\lib\site-packages\pdfkit\configuration.py", line 27, in __init__
'https://github.com/JazzCore/python-pdfkit/wiki/Installing-wkhtmltopdf' % self.wkhtmltopdf)
IOError: No wkhtmltopdf executable found: ""
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

我搜索了很多,但仍然找不到解决方案。谁能帮帮我?

【问题讨论】:

    标签: python-2.7 wkhtmltopdf pdfkit


    【解决方案1】:

    我找到了解决方案,我不知道为什么,但是由于“\b”,python 将我的环境路径“C:\Program Files\wkhtmltopdf\bin”替换为“C:\Program Files\wkhtmltopdin”所以我只需将“\b”替换为“/b”并解决。

    【讨论】:

      猜你喜欢
      • 2017-07-14
      • 2015-02-24
      • 2017-05-07
      • 2020-09-02
      • 2015-01-22
      • 2014-06-27
      • 1970-01-01
      • 2013-11-13
      • 2021-11-30
      相关资源
      最近更新 更多