title: ImportError using matplotlib TKinter Backend
body: <p>I'm developing a user interface in python using the <code>Tkinter</code> interface and the matplotlib TkAgg backend for drawing graphs on a Linux machine. A week ago, I had a working code, but then some system reboot/update was issued. </p>
  
  <p>Now I'm facing an issue importing matplotlib together with its TkAgg backend. This is a very reduced version of the official Tkinter <a href="http://matplotlib.org/examples/user_interfaces/embedding_in_tk.html" rel="nofollow">embedding example</a> from the matplotlib page (the example itself does not work, either, crashing with the same ImportError):</p>
  
  <pre><code>import matplotlib
  matplotlib.use('TkAgg')
  import matplotlib.pylab as plt
  
  plt.plot([1,2,3], [1,3,5])
  plt.show()
  </code></pre>
  
  <p>I run this script from the console and get the following output:</p>
  
  <pre><code>&lt;58&gt; python matplotlibtkinter.py --verbose-helpful
  $HOME=/home/optimi/bzfhende
  matplotlib data path /usr/lib64/python2.7/site-packages/matplotlib/mpl-data
  loaded rc file /home/optimi/bzfhende/.matplotlib/matplotlibrc
  matplotlib version 1.3.1
  verbose.level helpful
  interactive is False
  platform is linux2
  CACHEDIR=/home/optimi/bzfhende/.matplotlib
  Using fontManager instance from /home/optimi/bzfhende/.matplotlib/fontList.cache
  Traceback (most recent call last):
     File "matplotlibtkinter.py", line 3, in &lt;module&gt;
         import matplotlib.pylab as plt
     File "/usr/lib64/python2.7/site-packages/matplotlib/pylab.py", line 269, in &lt;module&gt;
         from matplotlib.pyplot import *
     File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line 98, in &lt;module&gt;
  _      backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
     File "/usr/lib64/python2.7/site-packages/matplotlib/backends/__init__.py", line 28, in pylab_setup
         globals(),locals(),[backend_name],0)
     File "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_tkagg.py", line 14, in &lt;module&gt;
         import matplotlib.backends.windowing as windowing
  ImportError: No module named windowing
  </code></pre>
  
  <p>I asked our admin to update the system-wide matplotlib installation, but this did not resolve the issue.
  Googling troubles with the windowing backend does not show any direct hit. 
  It must have something to do with the installed packages, but I am still reluctant to set up an individual installation : If the system-wide configuration is not repaired, other people in my group checking out the tool will end up posting the same question here.</p>
  
  <p>I appreciate every help you can give me on reparing this.  </p>
  
  <p>EDIT: Maybe I should mention that, no matter what backend I choose, I do not see plots anymore.</p>
  
  <p>EDIT2: Thanks to user tcaswell, I figured that the reason for the Error is the simplest reason one can imagine: windowing.{py|pyc} is missing in the matplotlib/backends directory. For rebuilding matplotlib, I checked out the latest version from git as mentioned in the <a href="http://matplotlib.org/faq/installing_faq.html#source-install-from-git" rel="nofollow">matplotlib-faq</a>. From the matplotlib-repo, running </p>
  
  <pre><code>python setup.py build
  </code></pre>
  
  <p>reveals that the tk-dev libraries/headers are missing for rebuilding the tkagg-backend </p>
  
  <p>LAST EDIT: After having the tk-dev package at hand, I was able to locally build and
  install matplotlib inside a virtual environment. This was the trick.</p>