色综合图-色综合图片-色综合图片二区150p-色综合图区-玖玖国产精品视频-玖玖香蕉视频

您的位置:首頁技術文章
文章詳情頁

python html如何轉成PDF?

瀏覽:123日期:2022-08-07 13:35:50

問題描述

import pdfkitpdfkit.from_url(’http://www.cocoachina.com/’, ’out.pdf’)

老報錯我已經安裝了wkhtmltopdf :還請大神幫忙解決!

還有如何將wkhtmltopdf的執行路徑添加到系統環境$PATH變量中?

Traceback (most recent call last): File '/Library/Frameworks/Python.framework/Versions/3.6/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’’During handling of the above exception, another exception occurred:Traceback (most recent call last): File '/Users/peibobo/PycharmProjects/bottle/pdf_test.py', line 3, in <module> pdfkit.from_url(’http://www.cocoachina.com/’, ’out.pdf’) File '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pdfkit/api.py', line 24, in from_url configuration=configuration, cover_first=cover_first) File '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pdfkit/pdfkit.py', line 42, in __init__ self.configuration = (Configuration() if configuration is None File '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pdfkit/configuration.py', line 27, in __init__ ’https://github.com/JazzCore/python-pdfkit/wiki/Installing-wkhtmltopdf’ % self.wkhtmltopdf)OSError: No wkhtmltopdf executable found: 'b’’'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

問題解答

回答1:

首先是你21行這句錯誤with open(self.wkhtmltopdf) as f:

應該是self.wkhtmltopdf為空字符串,沒有可以打開的文件

標簽: Python 編程
相關文章:
主站蜘蛛池模板: 毛片网站在线看 | 国产亚洲一区二区三区在线 | 国产制服 国产制服一区二区 | 欧美日韩在线视频一区 | 日本高清在线精品一区二区三区 | 日本欧美韩国一区二区三区 | 成人免费夜片在线观看 | 激情性爽三级成人 | 国产90后美女露脸在线观看 | 97精品国产高清在线看入口 | 欧美一级做一a做片性视频 欧美一级做一级爱a做片性 | 日本午夜vr影院新入口 | 久久久久久a亚洲欧洲aⅴ | 成人欧美一级毛片免费观看 | 国产在线91精品入口首页 | 一区二区三区视频在线观看 | 国产欧美精品区一区二区三区 | 国产精品每日更新在线观看 | 99精品国产综合久久久久 | 亚洲成人综合在线 | 久久国产视频网 | 欧美成人一区二区 | 国产高清天干天天视频 | 免费国产精品视频 | 亚洲第一网站在线观看 | 手机亚洲第一页 | 国产精选一区二区 | 免费人成年短视频在线观看免费网站 | 中文欧美一级强 | 国产三级精品三级国产 | 国内高清久久久久久久久 | 特级片免费看 | 久久国产视频一区 | 国产成综合 | 亚洲精品成人一区 | 视频一区二区三区自拍 | 国产第三区 | 日韩欧国产精品一区综合无码 | 欧美a大片 | 小草青青神马影院 | 在线国产区 |