How to run PyQt4 app in Ubuntu terminal?

I tried to run a PyQt4 app, but got following error:

cannot connect to X server :0.0

It seems i need to install the "X server", what's this? How to install it easily?

Thanks a lot.

4 Replies

You'll need some sort of graphical environment locally, and (depending on what it is) might need to install a boatload of stuff on the Linode too. What OS are you running at home?

(In the X Window System paradigm, the "server" is what draws the pictures and stuff on your monitor, and the "client" is the program you're running.)

@hoopycat:

You'll need some sort of graphical environment locally, and (depending on what it is) might need to install a boatload of stuff on the Linode too. What OS are you running at home?

(In the X Window System paradigm, the "server" is what draws the pictures and stuff on your monitor, and the "client" is the program you're running.)

Thanks for your reply.

I am using Linode VPS with Ubuntu 10.0.4.

I want to run a Python script which uses PyQt4.

I tried to start the Python script, i got that error.

I've used this to install a desktop on my linode:

apt-get install gnome-desktop

This will install Gnome and X. I do this because I use nxserver on my linode as a development server.

Another method instead of running an X server on your linode is to forward X over your ssh connection, like so:

[redice@redices-home-machine ~]$ ssh -X -C user@redices-linode

Then you can run your Python script on the linode, and whatever X stuff it does should appear on your desktop. This of course assumes you are running X on your home system.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct