Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install Tkinter on debian sid?

I need to install tkinter on debian. After some research[1][2], I noticed that Tkinter should be automatically installed with Python. However, when I try to import the module, I get the following:

>>> import tkinter
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named tkinter

When I try to import Tkinter, the error changes:

>>> import Tkinter
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 42, in <module>
    raise ImportError, str(msg) + ', please install the python-tk package'
ImportError: No module named _tkinter, please install the python-tk package

So I try to install the python-tk package via apt-get. Another error comes out:

E: Failed to fetch http://ftp.us.debian.org/debian/pool/main/t/tk8.5/tk8.5_8.5.14-2_amd64.deb  404  Not Found [IP: 64.50.233.100 80]

I'm on debian sid, amd64.

like image 422
Amaury Medeiros Avatar asked Apr 04 '14 21:04

Amaury Medeiros


1 Answers

It seems your packages list is out of date, first retrieve new lists of packages by:

apt-get update

And then install python-tk package with:

apt-get install python-tk
like image 174
Omid Raha Avatar answered Oct 30 '22 13:10

Omid Raha