ImportError: No module named Tkinter

89 views
Skip to first unread message

刘旭东

unread,
Apr 29, 2015, 3:43:43 PM4/29/15
to pyscr...@googlegroups.com
Hi guys,

I want to show a window using Tkinter, the code just looks like:

try:
    # Python2
    import Tkinter as tk
except ImportError:
    # Python3
    import tkinter as tk
def main():
    win=graphics.GraphWin()
    print win.getWidth()


but Pyscripter give me the error information:

Traceback (most recent call last):
  File "<string>", line 254, in run_nodebug
  File "D:\GoCloud\code\topic\drawpoints.py", line 17, in <module>
    import tkinter as tk
ImportError: No module named tkinter

but in the command environment, there is no error. What's wrong with Pyscripter? my Pyscripter version is 2.6 x64

William Warren

unread,
Jun 29, 2015, 1:23:23 AM6/29/15
to pyscr...@googlegroups.com
I have the same problem, the file needs to be a compiled python file in order to use it. But i so not know how to so this.
Reply all
Reply to author
Forward
0 new messages