Ubuntu package "python3" does not include tkinter

Steven D'Aprano steve+comp.lang.python at pearwood.info
Mon Apr 22 05:18:24 EDT 2013


On Mon, 22 Apr 2013 03:08:24 -0500, Andrew Berg wrote:

> Much of the stdlib doesn't rely on anything but the core interpreter.
> tkinter by itself is not the issue. As you said, the bindings are tiny.
> However, in order to be usable, it requires quite a few things - most
> notably X. On desktop Linux, this is already installed, but on server
> systems, it generally is not (or at least shouldn't be in most cases).
> Going back to my example of a web server using a Python-based framework,
> I'll repeat that there is no reason such a system should have X even
> installed in order to serve web pages. Even on a lean, mean server
> machine, CPython requires only a few extra libraries. Add tkinter, and
> suddenly you have to install a LOT of things. If you plan to actually
> use tkinter, this is fine. If not, you've just added a lot of stuff that
> you don't need. This adds unnecessary overhead in several places (like
> your package system's database).


I can't disagree with any of this, except to say that none of this 
justifies having a separate package for Tkinter. Naturally if you don't 
have X, Tcl won't work, and if Tcl won't work, Tkinter won't work and 
should give an import error. But that doesn't imply that X must be a 
dependency for Python. It's a dependency for having Tkinter *work*, but 
not for *installing* Tkinter as part of the standard library.

Hell, even if you have X installed, and Tcl, and the Tkinter packages, 
importing tkinter can still fail, if Python wasn't built with the right 
magic incantations for it to recognise that Tcl is installed.


-- 
Steven



More information about the Python-list mailing list