On a new 17.04 Ubuntu system, with python and python-matplotlib, I wanted to plot using the Matplotlib GTKAgg or GTKCairo backends. This works nicely in 16.04, but is broken in 17.04, as a result of the following:
>>> import matplotlib.backends._backend_gdk
ImportError: No module named _backend_gdk
But the same command works perfectly in 16.04. Consequently
import matplotlib; matplotlib.use("GTKCairo");
import pylab; pylab.plot([1,2],[3,4]);pylab.show()
works perfectly in 16.04, and fails with the 'no module named' error (as above) on 17.04. I can see that my 17.04 system has the file /usr/lib/python2.7/dist-packages/matplotlib/backends/_backend_gdk.x86_64-linux-gnu.so, so how is this error arising? Any suggestions for workarounds?