Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We are trying to set up a virtual development / research cloud environment for our students. Students need to be able to log-in, launch python IDE, and plot some graphs for their homework.

We are running 64bit Ubuntu 12.10, with Python and IDLE ide installed. Students login with using ssh -X and launch IDLE, which spawns a GUI window.

Problem: running something like this in the ide

spawns a new window. BUT when we try something like this:


Nothing happens, where we would expect a new window to spawn and show the plot (thats what happens on the local machine). I suspect this has something to do with X11 but at this point I am way out of my depth of sys admin knowledge. Confirmed this both from a Mac (xQuartz) and PC (xming) client. Any help would be much appreciated.

share|improve this question
up vote 2 down vote accepted

Got it.

matplotlib uses a rendering backend which has to play nice with x11. But selecting the right backend manually [matplotlib.use('TkAgg')] would throw an exception. Turns out that matplotlib does not build correctly under ubuntu with pip, missing some dependencies--specifically the ones needed for x11-friendly backends (setting the default to 'Agg' in matplotlibrc). Fixed by:

pip uninstall matplotlib           //unistall matplotlib
apt-get build-dep matplotlib       //download and build needed dependencies
pip -U matplotlib                  //force matplotlib rebuild

The above correctly sets the default backend to TkAgg (in matplotlibrc). Hope that helps someone!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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