You are not logged in.

#1 2014-05-25 22:36:02

Registered: 2014-05-25
Posts: 1

Python: Tkinter does not work

As the title says, Tkinter does not work even though I have it installed.

[ishwagakill@arch ~]$ python
Traceback (most recent call last):
  File "", line 1, in <module>
    import Tkinter
  File "/usr/local/lib/python2.7/lib-tk/", line 39, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
ImportError: No module named _tkinter

Am using Python 2.7.6

sudo pacman -S tk 

Does not solve the problem


#2 2014-05-26 00:33:33

Bug Wrangler
Registered: 2012-09-01
Posts: 6,816

Re: Python: Tkinter does not work

So, you've changed the python symlink?


#3 2014-05-27 15:47:19

Registered: 2009-01-22
Posts: 114

Re: Python: Tkinter does not work

A few comments:

Invoking python with "python" should call up python3.4; if you intend python2.7, I think you need to use python2 on the command line. (Warning: I use python3 almost exclusively, so I don't know exactly what happens if you have only python2 installed, if that is even possible.)

Then, why is the path to tkinter in /usr/local/...? It should be in /usr/lib/python2.7/... to make any sense.

Last, do you have tcl/tk installed? It's not a hard requirement for python, only optional, so if you want to use tkinter, you need to install tk explicitly.

Linux User #353 - SLS -> Slackware -> Red Hat -> Mandrake -> Fedora -> Arch


Board footer

Powered by FluxBB