Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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

 
discard

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.