Can't import tkinter (or Tkinter)
<p>I am trying to import Tkinter to my project using Python 2.7 and instead I get the error:</p>

<pre><code>ImportError: No module named tkinter
</code></pre>

<p>Before anyone says it, I have tried both "Tkinter" and "tkinter" but have gotten the exact same message.</p>

<p>First try using this code for your imports.</p>

<pre><code>try:
    import Tkinter as tk # this is for python2
except:
    import tkinter as tk # this is for python3
</code></pre>

<p>If this doesn't work, try reinstalling tkinter. If you don't know how to reinstall tkinter look at the tkinter installation page,<a href="http://www.tkdocs.com/tutorial/install.html" rel="nofollow"> here.</a> </p>

python import tkinter