下载包之后还是提示我需要下载

来源:3-10 Word转PDF

weixin_慕运维6121532

2022-08-20 11:19:08



��Ϣ: ���ṩ��ģʽ�޷��ҵ��ļ���

Traceback (most recent call last):

  File "C:\Program Files\Python38\lib\site-packages\pdfkit\configuration.py", line 35, in __init__

    with open(self.wkhtmltopdf) as f:

FileNotFoundError: [Errno 2] No such file or directory: b''


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "D:/Dracy_2022/2022_dracyStudy/pythonStudy/自动化/word/pdf操作.py", line 20, in <module>

    pdfkit.from_url("https://www.imooc.com","mooc.pdf")  # 越复杂的网址,失败频率越高

  File "C:\Program Files\Python38\lib\site-packages\pdfkit\api.py", line 24, in from_url

    r = PDFKit(url, 'url', options=options, toc=toc, cover=cover,

  File "C:\Program Files\Python38\lib\site-packages\pdfkit\pdfkit.py", line 45, in __init__

    self.configuration = (Configuration() if configuration is None

  File "C:\Program Files\Python38\lib\site-packages\pdfkit\configuration.py", line 38, in __init__

    raise IOError('No wkhtmltopdf executable found: "%s"\n'

OSError: No wkhtmltopdf executable found: "b''"

If this file exists please check that this process can read it or you can pass path to it manually in method call, check README. Otherwise please install wkhtmltopdf -

https://github.com/JazzCore/python-pdfkit/wiki/Installing-wkhtmltopdf



我之前自定义了这个插件安装地址,后来卸载掉,然后默认安装在C盘还是不行,这需要设置环境变量还是什么?请指教一下


写回答

1回答

好帮手慕燕燕

2022-08-20

同学,你好!检查一下是否有安装 wkhtmltopdf 依赖包,并且要指定其 configuration 配置,详细步骤参考:https://class.imooc.com/lesson/2102#mid=58018 

祝:学习愉快!

0
heixin_慕运维6121532
hp>谢谢,我自己再评论区找到了,已解决。栓Q

h022-08-20
共1条回复

0 学习 · 4469 问题

查看课程