Python 3.x PDFKit FileNotFoundError Python
我正在尝试使用Python3中的pdfkit将html文件转换为PDF。我在macOS Mojave中使用PyCharm,这是我在尝试运行代码时遇到的错误:Python 3.x PDFKit FileNotFoundError Python,python-3.x,macos,python-pdfkit,Python 3.x,Macos,Python Pdfkit,我正在尝试使用Python3中的pdfkit将html文件转换为PDF。我在macOS Mojave中使用PyCharm,这是我在尝试运行代码时遇到的错误: Traceback (most recent call last): File "/Users/cesarvargas/miniconda3/envs/test/lib/python3.6/site- packages/pdfkit/configuration.py", line 21, in __init__ w
Traceback (most recent call last):
File "/Users/cesarvargas/miniconda3/envs/test/lib/python3.6/site-
packages/pdfkit/configuration.py", line 21, in __init__
with open(self.wkhtmltopdf) as f:
FileNotFoundError: [Errno 2] No such file or directory: b''
这是我正在使用的代码:
import pdfkit
if __name__ == "__main__":
with open("test.html") as f:
t = pdfkit.from_file(f, False)
我已经解决了错误,安装了WKHTMLtoPDF二进制文件: 更多信息请点击此处: