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 ? Commented Jul 21, 2010 at 15:42
  • Yes, it seems to point out a "No protocol specified" error. Commented 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
Sign up to request clarification or add additional context in comments.

Comments

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 Comment

I was lauchning a brand new one, so it's not about rights. But your syntax correction saved me !

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.