1

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

nltk.download()

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

book2.dispersion_plot("chair")

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.

denten
  • 111
  • 2

1 Answers1

0

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           //unistalls 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!

denten
  • 111
  • 2