This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: tkinter doesn't see _tkinter
Type: compile error Stage: resolved
Components: Tkinter Versions: Python 3.1
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: brian.curtin, orsenthil, py.user
Priority: normal Keywords:

Created on 2010-04-28 01:47 by py.user, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (10)
msg104397 - (view) Author: py.user (py.user) * Date: 2010-04-28 01:47
[guest@station ~]$ python3
Python 3.1.2 (r312:79147, Apr 28 2010, 11:57:19)
[GCC 4.1.2 20070925 (Red Hat 4.1.2-33)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 1+2
>>> import tkinter
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.1/tkinter/", line 39, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
ImportError: No module named _tkinter
msg104398 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2010-04-28 02:01
Did you compile Python yourself or did this come on your OS? The comment in the traceback pretty much says it all.
msg104401 - (view) Author: py.user (py.user) * Date: 2010-04-28 02:25
I have downloaded Python today (28 Apr) from the site
I have a version under WinXP (it works fine), but I don't use WinXP
When it told this about _tkinter, I even read the README file and compiled it with "make test", and there the same thing, it couldn't find _tkinter
as for Python2.5 it's allright, but it has another Tkinter, so sources are not portable
msg104405 - (view) Author: py.user (py.user) * Date: 2010-04-28 03:47
tryed also:
[root@station python3.1]# cp /usr/lib/python2.5/lib-dynload/ lib-dynload

answer is:
Traceback (most recent call last):
  File "/home/guest/tmp/code/c/eclipse/pytest/src/", line 4, in <module>
    import tkinter
  File "/usr/local/lib/python3.1/tkinter/", line 39, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
ImportError: /usr/local/lib/python3.1/lib-dynload/ undefined symbol: _Py_ZeroStruct
msg104409 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2010-04-28 04:27
From your prompt, it seems you are on Unix based system. make would have informed you about _tkinter not built.

If you are on ubuntu, do a sudo apt-get install tk-dev  and install tk-dev package and its dependencies.
And then do the ./configure;make;sudo make install 
python3.1 will have the tkinter libraries and the _tkinter module installed. If on another distro, just make sure you have latest tk-dev libraries (headers) installed.

I don't see any other problem here, so I am closing this issue.
msg104412 - (view) Author: py.user (py.user) * Date: 2010-04-28 05:59
ok, thank you
I found that I have no tcl.h and tk.h
msg104413 - (view) Author: py.user (py.user) * Date: 2010-04-28 06:25
allright I installed two -dev packages and ran tkinter
msg120111 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2010-11-01 04:46
Not sure, why changed the resolution. It is an invalid bug report. You could have resolved it by a little research or by asking around.
msg120112 - (view) Author: py.user (py.user) * Date: 2010-11-01 08:30
I thought this will put the topic from unresolved to resolved
Now I see this is for bugs only
msg157650 - (view) Author: py.user (py.user) * Date: 2012-04-06 07:59
testing new e-mail
Date User Action Args
2022-04-11 14:57:00adminsetgithub: 52801
2012-04-06 07:59:39py.usersetmessages: + msg157650
2010-11-01 08:30:14py.usersetmessages: + msg120112
2010-11-01 04:46:12orsenthilsetresolution: fixed -> not a bug
messages: + msg120111
2010-11-01 04:32:56py.usersetresolution: not a bug -> fixed
2010-04-28 06:25:22py.usersetmessages: + msg104413
2010-04-28 05:59:09py.usersetmessages: + msg104412
2010-04-28 04:27:56orsenthilsetstatus: open -> closed

nosy: + orsenthil
messages: + msg104409

resolution: not a bug
stage: resolved
2010-04-28 03:47:27py.usersetmessages: + msg104405
2010-04-28 02:25:51py.usersetmessages: + msg104401
2010-04-28 02:01:53brian.curtinsetnosy: + brian.curtin
messages: + msg104398
2010-04-28 01:47:34py.usercreate