Using PyQt4.QtWebKit on a Debian server
-
26-09-2020 - |
Question
I'm having a problem using PyQT4 on a Debian server. My script works fine on an Ubuntu Desktop machine, and I now want to deploy it on a server.
Knowing it needed an X server, I launched one doing
vncserver --display 800x600 :4242
I then exported the display :
export DISPLAY=:4242
But my program keeps returning the error
cannot connect to X server :4242
Any idea ?
Solution
It's not --display, it's -geometry.
I would guess you don't have the rights to connect to the vncserver. It was already running, wasn't it ? Try running another instance.
OTHER TIPS
Instead of using vncserver, you could use (at least on Debian) xvfb - Virtual Framebuffer 'fake' X server.
After installing this package simply run:
$ xvfb-run python your_script.py
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow