Ubuntu package "python3" does not include tkinter

Steven D'Aprano steve+comp.lang.python at pearwood.info
Fri Apr 19 20:05:14 EDT 2013


On Fri, 19 Apr 2013 10:17:58 -0700, lcrocker wrote:

> Am I mistaken in my belief that tkinter is a non-optional part of the
> Python language? I installed the "python3" package on Ubuntu, and
> tkinter is not included--it's an optional package "python3-tk" that has
> to be installed separately. I reported this as a bug as was summarily
> slapped down.

Personally, I think that is a silly design by Ubuntu, but tkinter is 
optional and they're free to distribute Python with or without it. That 
becomes a *quality of implementation* issue: some distributions may be 
more complete, easier to install, more up-to-date, etc. than others, but 
they're still Python.

There is Python the language, which is distinct from the CPython 
implementation (to say nothing of other implementations like Jython, 
IronPython, Stackless, PyPy, ...), and then there is the standard 
library. Much of the standard library is optional, although unfortunately 
the documentation doesn't really make that as clear as it should.

Tkinter depends on you have Tk/Tcl installed, which on Linux and Unix 
systems depends on you having X installed. Personally, I think that a 
good packaging system should ensure that once you install Tk/Tcl, tkinter 
should "just work". But there may be technical reasons why this is 
impossible.

If you ever build Python from source, you will often get warnings that it 
could not build certain modules. I spent a fruitless couple of hours last 
week trying to install Python 2.7 from scratch with sqlite, before giving 
up. What I got was still Python 2.7. It was just Python 2.7 without 
sqlite (and four or five other modules, which I don't care about and 
don't remember).


> Can we apply some pressure to Ubuntu to fix this? Python is a trademark,
> is it not? Can Ubuntu legally claim that their "Python" package is an
> implementation of the language if it does not include the whole
> language?

Tkinter is not part of the language. The tkinter module is an interface 
to another language, not part of Python the language itself. There are 
platforms where Tk/Tcl do not exist, platforms which may not even have a 
GUI environment at all. Do you really intend to say that it is forbidden 
to have Python on such platforms?



-- 
Steven



More information about the Python-list mailing list