ImportError: Gtk* Backend Requires pygtk to Be Installed

If you see a message similar to this:

 Traceback (most recent call last):
   File "", line 1, in
   File "./zipdir/", line 83, in
   File "./zipdir/NL/Calculators/HuckelCalculator/", line 75, in
   File "./zipdir/NL/Analysis/", line 2, in
   File "./build/lib/python2.7/site-packages/", line 1, in
   File "./build/lib/python2.7/site-packages/matplotlib/", line 265, in
   File "./build/lib/python2.7/site-packages/matplotlib/", line 97, in
   File "./build/lib/python2.7/site-packages/matplotlib/backends/", line 25, in pylab_setup
   File "./build/lib/python2.7/site-packages/matplotlib/backends/", line 16, in
 ImportError: Gtk* backend requires pygtk to be installed.

then check the file $HOME/.matplotlib/matplotlibrc. If it contains the line

 backend   : GTK

then change this to

 backend   : TkAgg

and hopefully the problem is fixed. Read more about matplotlib customization here.