python - AttributeError: 'module' object has no attribute 'Tk' -


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

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -