1

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 ?

2
  • Did you try to strace python your_script.py to see how it tries to connect ?
    – Scharron
    Jul 21, 2010 at 15:42
  • Yes, it seems to point out a "No protocol specified" error. Jul 21, 2010 at 15:45

2 Answers 2

2

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
0

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.

1
  • I was lauchning a brand new one, so it's not about rights. But your syntax correction saved me ! Jul 21, 2010 at 15:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.