Ubuntu package "python3" does not include tkinter

Steven D'Aprano steve+comp.lang.python at pearwood.info
Mon Apr 22 03:17:27 EDT 2013


On Mon, 22 Apr 2013 07:36:47 +0100, Rui Maciel wrote:

> Steven D'Aprano wrote:
> 
>> It's only easy to install a package on Ubuntu if you know that you have
>> to, and can somehow work out the name of the package.
> 
> No one actually has to install tkinter.  That's the whole point of
> providing it as a separate package: only those who want to use it have
> to install it. The rest of us don't.

I think that if you are worrying about the overhead of the tkinter 
bindings for Python, you're guilty of premature optimization. The tkinter 
package in Python 3.3 is trivially small, under 2 MB.

Besides, how far do we go? Do we expect people to install (say):

python3-copy

so that those who don't need the copy module don't have to install it?

sudo apt-get python3 python3-copy python3-dis python3-doctest \
     python3-csv python3-logging python3-shutil ...


There are advantages to having the *standard library* actually be, you 
know, *standard*.

In my perfect world, the tk/tcl bindings and the tkinter package would be 
installed with any Python installation. Naturally they won't work if you 
don't install Tcl, but to make them work, all you need is:

sudo apt-get python3 tcl

Don't want Tcl? Fine, don't install it, and "import tkinter" will fail at 
import time, preferably with a sensible error message like "Tcl not 
installed".

Naturally I'm just talking about the standard CPython implementation on 
Linux systems where Tcl is standard. If you have an embedded system, 
where tkinter's 2MB is *not* trivially small, or a platform where Tcl 
does not exist, then that's a different story. But in a standard Linux 
desktop install of Python, tkinter should Just Work once you install Tcl.

In my perfect world.



-- 
Steven



More information about the Python-list mailing list