在使用 pdfkit.from_string 或者 pdfkit.from_file 或者 pdfkit.from_url 字符串 文件 或者 网页 内容转化为 pdf 时,报错:

OSError: No wkhtmltopdf executable found

原因很明显,就是没找到可执行的wkhtmltopdf文件,也就是未找到wkhtmltopdf.exe文件。
python的pdfkit扩展包使用时需要基于wkhtmltopdf.exe这个可执行文件才可运行,因此需要先安装wkhtmltopdf。
对于windows系统,可以在(https://wkhtmltopdf.org/downloads.html)下载安装,然后将该程序的执行文件路径添加到环境变量中(这样即可直接用pdfkit扩展包,否则需要在使用pdfkit时,指明该程序的路径)

Ubuntu系统可以直接使用以下命令安装:
$sudo apt-get install wkhtmltopdf
CentOS系统可以直接使用以下命令安装:
$sudo yum intsall wkhtmltopdf

安装完之后再使用pdfkit扩展包即可解决上述问题。

ps:如果在windows系统下,下载安装了wkhtmltopdf程序,但是未加入到环境变量,可以使用以下指明该程序可执行路径的方法:

path_wk = r"D:\wkhtmltopdf\bin\wkhtmltopdf.exe" #wkhtmltopdf安装位置
config = pdfkit.configuration(wkhtmltopdf = path_wk)
pdfkit.from_string(html_str, r"output.pdf",configuration=config)
                    在使用pdfkit.from_string或者pdfkit.from_file或者pdfkit.from_url将字符串、文件或者网页内容转化为pdf时,报错:OSError: No wkhtmltopdf executable found原因很明显,就是没找到可执行的wkhtmltopdf文件,也就是未找到wkhtmltopdf.exe文件。python的pdfkit扩展包使用时需要基于wkhtmltopdf.exe这个可执行文件才可运行,因此需要先安装wkhtmltopdf。对于windows
				
OSError:[Errno 4]Interrupted system call 问题描述: File “/anaconda2/python2.7/multiprocessing/reduction.py”, line 157, in rebuild_handle new_handle = recv_handle(conn) File “/anaconda2/python2.7/multiprocessing/reduction.py”, line 83, in recv_handle return _multiprocessing.recvfd(conn.fileno()) OSError:
OSError: no library called "cairo" was found no library called "libcairo-2" was found cannot load library 'libcairo.so.2': libcairo.so.2: cannot open shared object file: No such file or directory cannot load library 'libcairo.2.dylib': libcairo.2.dylib: cannot open shared object file: No such file or directory cannot load library 'libcairo-2.dll': libcairo-2.dll: cannot open shared object file: No such file or directory
Django开发项目使用MySQL数据库,然而部署到Ubuntu服务器的候会经常出错。 Django连接MySQL数据库需要依赖第三方库mysqlclient,然而服务器通过pip3 install mysqlclient 命令安装第三方库mysqlclient会经常报错ERROR: Command errored out with exit status 1: command: /home/bright/web/venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip
OSError: [Errno 22] Invalid argument问题解决问题描述解决方法那么问题出在哪了?总结 在做SSD目标检测算法的候,在predict.py文件中遇到了这么一个报错的问题。 // ERROR Traceback (most recent call last): File "D:/ssd-keras-fromCSDN-Parathyoid/predict.py", line 7, in image = Image.open("‪C:\Users\qw\Desktop\000000.jpg") File "D:\anaconda\envs\
如下:1、 允许文件或者文件夹名称不得超过255个字符; 2、 文件名除了开头之外任何地方都可以使用空格; 3、 文件名中不能有下列符号:“?”、“、”、“╲”、“*”、““”、“”“、“”、“|”; 4、 文件名不区分大小写,但在显示可以保留大小写格式; 5、 文件名中可以包含多个间隔符,如“我的文件.我的图片.001”。 解决办法。 替换掉这些特殊字符就好啦! python: title = title.replace('?', '').replace('*', '').replace(' ', '') 作者:dr
import pdfkit config = pdfkit.configuration(wkhtmltopdf=r"D:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe") pdfkit.from_url(...
IOError: No wkhtmltopdf executable found: “”python使用pdfkit中,如果使用pdfkit.from_url 或者pdfkit.from_string等,就会出现上述错误。而且如果你使用pip安装了 wkhtmltopdf,还是会出现这个问题: If this file exists please check that this process ca
使用python中的使用 import shapely 不会报错,但是在使用 from shapely.geos import lgeos 会报错报错的详细信息如下图: 我们看到里面有一个关于geos_c.dll的文件,而报错的主要原因就出现在geos_c.dll这里,看了网上很多文章大部分说是geos_c.dll文件缺失的原因。我在网上找了几个geos_c.dll文件放到C:\Windows\System32 下任然没有解决问题。 最后解决方案:卸载原来安装的shapely包,然后  在https://www.lfd.uci.edu/~gohlke/pythonlibs/#shape
候会碰到cuda报错OSError: libcudart.so.10.0: cannot open shared object file: No such file 原因是cuda动态链接库没有链接上。 解决方法如下: cuda10.0: sudo ldconfig /usr/local/cuda-10.0/lib64 cuda9.0: sudo ldconfig /usr/local/cuda-9.0/lib64/ ldconfig 命令的用途,主要是在默认搜寻目录(/lib和/usr/lib)以及动态库配置文件/etc/ld.so.conf内所列的目录下,搜索出可共享的动态
免费软件:LGPLv3 许可证 适用于 python 2.7+ 和 python 3.2+ 和 pypy 目前公开了 23 个低级 glibc 函数(见下文)、10 个数据类型和 118 个常量。 所有有用的 glibc 功能都在范围内(欢迎使用补丁!) from glibc import ... -- 通过延迟导入直接访问 glibc 常量、函数和类型、快速启动、低内存开销、对 glibc 的高效调用 根据每个支持功能的文档(手册页)翻译错误代码。 使用适当的值和自定义的、易于理解的错误消息引发 OSError使用声明式“绑定”,易于验证正确性,易于添加更多类型、函数和常量。 内置测试验证每个常量的值,每个结构/联合字段的大小和偏移量以及整个结构/联合的大小。 在原始函数(pyglibc.select、pygl
在工作自动化过程中,有需要使用Pythonpdfkit包将URL或者str等转换成pdf文件,今天使用如下代码在将str转换为pdf, 代码如下: options = { 'page-size':'Letter','margin-top':'0.75in','margin-right':'0.75in', 'margin-bottom':'0.75in','margin-left':'0.75in','encoding':"UTF-8", 'custom-header': [('Accept-Enco
Python-PDFKit: HTML to PDF wrapper Github:https://github.com/JazzCore/python-pdfkit 这个第三方库是Ruby PDFKit库的改编版本,实际上是对wkhtmltopdf进行的一次封装。所以,在使用这个库,应该也安装上wkhtmltopdf库。 1. Install python-pdfkit: $ pip install pdfkit (or pip3 for python3) 2. Install wkhtm
这个错误通常是由于缺少 wkhtmltopdf 或者路径错误导致的。如果你已经安装了 wkhtmltopdf,你可以尝试使用 `--path` 指定 wkhtmltopdf 执行文件的路径,例如: ```python from pdfkit import PDFKit pdfkit = PDFKit(html, 'string') pdfkit.to_pdf('/path/to/output.pdf', options={'--path': '/path/to/wkhtmltopdf'}) 如果你没有安装 wkhtmltopdf,请根据你的操作系统安装 wkhtmltopdf。可以从 wkhtmltopdf 的官方网站下载安装程序:https://wkhtmltopdf.org/downloads.html。安装完成后,将 wkhtmltopdf 的路径添加到系统环境变量中。