Python 在智力上有困难

Python 在智力上有困难,python,wkhtmltopdf,imgkit,Python,Wkhtmltopdf,Imgkit,说到python,我真是个笨蛋。所以可能有一个非常简单的解决方案 我正试图用imgkit捕捉网页截图。但是,在pycharm中运行脚本时,我不断遇到以下错误: Traceback (most recent call last): File "C:\Users\name\PycharmProject\websitescreenshot\venv\lib\site-packages\imgkit\config.py", line 30, in __init__ with open(sel

说到python,我真是个笨蛋。所以可能有一个非常简单的解决方案

我正试图用imgkit捕捉网页截图。但是,在pycharm中运行脚本时,我不断遇到以下错误:

Traceback (most recent call last):
  File "C:\Users\name\PycharmProject\websitescreenshot\venv\lib\site-packages\imgkit\config.py", line 30, in __init__
    with open(self.wkhtmltoimage):
FileNotFoundError: [Errno 2] No such file or directory: b''

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:/Users/name/PycharmProject/websitescreenshot/Test.py", line 3, in <module>
    imgkit.from_url('https://pypi.org/project/imgkit/', 'out.jpg')
  File "C:\Users\name\PycharmProject\websitescreenshot\venv\lib\site-packages\imgkit\api.py", line 31, in from_url
    cover_first=cover_first)
  File "C:\Users\name\PycharmProject\websitescreenshot\venv\lib\site-packages\imgkit\imgkit.py", line 34, in __init__
    self.config = Config() if not config else config
  File "C:\Users\name\PycharmProject\websitescreenshot\venv\lib\site-packages\imgkit\config.py", line 36, in __init__
    'http://wkhtmltopdf.org\n'.format(self.wkhtmltoimage))
OSError: No wkhtmltoimage executable found: "b''"
If this file exists please check that this process can read it. Otherwise please install wkhtmltopdf - http://wkhtmltopdf.org


Process finished with exit code 1

您看到崩溃是因为
PATH
变量中缺少
wkhtmltopdf
,或者您的系统上没有安装它。通过软件包管理器安装工具后,它应该可以工作

对于Ubuntu运行:

sudo apt get install wkhtmltopdf

您看到崩溃是因为
PATH
变量中缺少
wkhtmltopdf
,或者您的系统上没有安装该变量。通过软件包管理器安装工具后,它应该可以工作

对于Ubuntu运行:

sudo apt get install wkhtmltopdf

欢迎来到SO!请发布相关代码。嗨,佩德罗,代码到目前为止非常简单-我已经在上面添加了代码欢迎加入so!请张贴相关的代码。嗨,佩德罗,代码是非常简单的到目前为止-我已经添加了上述代码
import imgkit

imgkit.from_url('http://google.com', 'out.jpg')