0

I have installed a Python library called eml2png. This library has a dependency on "wkhtmltopdf" which I have also installed. When I try making a call, I get the following error:

You need to install xvfb(sudo apt-get install xvfb, yum install xorg-x11-server-Xvfb, etc), then add option: {"xvfb": ""}.

I have installed this library, but I have no idea where I add the option {"xvfb": ""}. Can someone please explain this?

Thanks

Dave
  • 2,473
  • 2
  • 30
  • 55
  • Do you have a stack trace? Does the stack trace tell you which line of code, in which library, is throwing the error? Looking at the context of that code is a reasonable place to start. – Charles Duffy Oct 01 '20 at 22:15
  • 1
    Heh -- this turns out to be a duplicate of [using imgkit on ubuntu server](https://stackoverflow.com/questions/58556282/using-imgkit-on-ubuntu-server-wkhtmltopdf-could-not-connect-to-any-x-displa). – Charles Duffy Oct 01 '20 at 22:15

1 Answers1

0

After a quick look at the source (https://github.com/poipoii/eml2png/blob/master/src/eml2png/eml2png.py) I suggest trying:

eml2png.to_png('message.eml', options={"xvfb": "", "format": "png"}) 
edgars
  • 1,038
  • 1
  • 7
  • 17
  • That got past the error, but gave me a corrupted .png file. Do you know what the line "xvfb" option does? – Dave Oct 01 '20 at 22:26
  • @Dave, `xvfb` is a fake X11 server; it's used to run graphical programs on headless systems (ones that don't have a GUI). – Charles Duffy Oct 01 '20 at 23:05
  • @Dave, ...so, the presumptive use is to enable the library (which presumably has some kind of dependency on X11) to be usable on such headless systems. – Charles Duffy Oct 01 '20 at 23:16