OSError: wkhtmltoimage exited with non-zero code 1. error:
SambhavJain19 opened this issue · comments
I dont have Ubuntu on my system. So I tried it on a EC2 instance on Aws.
When I click on print PDF . I get this error
OSError: wkhtmltoimage exited with non-zero code 1. error:
qt.qpa.screen: QXcbConnection: Could not connect to display
Could not connect to any X display.
After googling I got to know it is because we don't get a display screen on aws. Except from Doing ssh -x .. and hosting pdf on localhost(which is taking a lot of time ). what is the other solution. Please help. thanks
Hi @SambhavJain19,
I have no idea.
I don't think there is an easy way to do what you would like to do.
Sorry, I am not at all an expert in GNU/Linux servers that run without X server/display.
- using:
from pyvirtualdisplay import Display - And adding couple of lines in hello.py did the job:
display = Display(visible=0, size=(600,600))
display.start()
That's a great solution, thanks!