python - AttributeError: 'module' object has no attribute 'Tk' -
this question has answer here:
i started learn gui developement using tkinter python library faced problem pycharm ide community edition 4.5.2
my problem is: when write code below in idle, works fine!!! when write using the pycharm ide, error message appears: attributeerror: 'module' object has no attribute 'tk' please me, need , thank lot
my code:
import tkinter app = tkinter.tk() app.title("hello world") app.minsize(300, 300) hellolabel = tkinter.label(app, text="hello gui") hellolabel.pack() app.mainloop()
note: i'm using python 2.7.6, os: ubuntu 14.04 lts
the problem named file tkinter.py
. when import, python sees file , tries import instead of tkinter library.
rename file, , sure remove tkinter.pyc
if exists.
Comments
Post a Comment