Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #43916 > unrolled thread

Ubuntu package "python3" does not include tkinter

Started bylcrocker <lee@piclab.com>
First post2013-04-19 10:17 -0700
Last post2013-04-20 00:05 +0000
Articles 20 on this page of 44 — 13 participants

Back to article view | Back to comp.lang.python


Contents

  Ubuntu package "python3" does not include tkinter lcrocker <lee@piclab.com> - 2013-04-19 10:17 -0700
    Re: Ubuntu package "python3" does not include tkinter Joel Goldstick <joel.goldstick@gmail.com> - 2013-04-19 13:25 -0400
      Re: Ubuntu package "python3" does not include tkinter lcrocker <leedanielcrocker@gmail.com> - 2013-04-19 10:30 -0700
    Re: Ubuntu package "python3" does not include tkinter Andrew Berg <bahamutzero8825@gmail.com> - 2013-04-19 12:35 -0500
      Re: Ubuntu package "python3" does not include tkinter lcrocker <leedanielcrocker@gmail.com> - 2013-04-19 10:42 -0700
        Re: Ubuntu package "python3" does not include tkinter rusi <rustompmody@gmail.com> - 2013-04-19 10:53 -0700
        Re: Ubuntu package "python3" does not include tkinter Andrew Berg <bahamutzero8825@gmail.com> - 2013-04-19 13:05 -0500
        Re: Ubuntu package "python3" does not include tkinter Sibylle Koczian <nulla.epistola@web.de> - 2013-04-20 18:10 +0200
          Re: Ubuntu package "python3" does not include tkinter Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-22 03:57 +0000
            Re: Ubuntu package "python3" does not include tkinter rusi <rustompmody@gmail.com> - 2013-04-21 21:10 -0700
            Re: Ubuntu package "python3" does not include tkinter Andrew Berg <bahamutzero8825@gmail.com> - 2013-04-21 23:24 -0500
              Re: Ubuntu package "python3" does not include tkinter rusi <rustompmody@gmail.com> - 2013-04-21 21:34 -0700
                Re: Ubuntu package "python3" does not include tkinter Andrew Berg <bahamutzero8825@gmail.com> - 2013-04-22 00:13 -0500
            Re: Ubuntu package "python3" does not include tkinter Rui Maciel <rui.maciel@gmail.com> - 2013-04-22 07:36 +0100
              Re: Ubuntu package "python3" does not include tkinter Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-22 07:17 +0000
                Re: Ubuntu package "python3" does not include tkinter Andrew Berg <bahamutzero8825@gmail.com> - 2013-04-22 03:08 -0500
                  Re: Ubuntu package "python3" does not include tkinter Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-22 09:18 +0000
                    Re: Ubuntu package "python3" does not include tkinter Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-04-22 14:52 +0200
                      Re: Ubuntu package "python3" does not include tkinter Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-23 00:22 +0000
                        Re: Ubuntu package "python3" does not include tkinter Chris Angelico <rosuav@gmail.com> - 2013-04-23 10:36 +1000
                          Re: Ubuntu package "python3" does not include tkinter Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-23 04:03 +0000
                            Re: Ubuntu package "python3" does not include tkinter Chris Angelico <rosuav@gmail.com> - 2013-04-23 14:11 +1000
                        Re: Ubuntu package "python3" does not include tkinter Andrew Berg <bahamutzero8825@gmail.com> - 2013-04-22 19:47 -0500
                          Re: Ubuntu package "python3" does not include tkinter Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-23 05:49 +0000
                            Re: Ubuntu package "python3" does not include tkinter Andrew Berg <bahamutzero8825@gmail.com> - 2013-04-23 02:33 -0500
                        Re: Ubuntu package "python3" does not include tkinter rusi <rustompmody@gmail.com> - 2013-04-22 20:50 -0700
                        Re: Ubuntu package "python3" does not include tkinter Rui Maciel <rui.maciel@gmail.com> - 2013-04-23 07:57 +0100
                Re: Ubuntu package "python3" does not include tkinter Rui Maciel <rui.maciel@gmail.com> - 2013-04-22 22:09 +0100
                  Re: Ubuntu package "python3" does not include tkinter Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-22 23:30 +0000
                    Re: Ubuntu package "python3" does not include tkinter Rui Maciel <rui.maciel@gmail.com> - 2013-04-23 07:44 +0100
                      Re: Ubuntu package "python3" does not include tkinter rusi <rustompmody@gmail.com> - 2013-04-23 05:01 -0700
                Re: Ubuntu package "python3" does not include tkinter Bob Martin <bob.martin@excite.com> - 2013-04-23 07:33 +0100
                  Re: Ubuntu package "python3" does not include tkinter Chris Angelico <rosuav@gmail.com> - 2013-04-23 16:41 +1000
                    Re: Ubuntu package "python3" does not include tkinter Rui Maciel <rui.maciel@gmail.com> - 2013-04-23 07:48 +0100
                      Re: Ubuntu package "python3" does not include tkinter Chris Angelico <rosuav@gmail.com> - 2013-04-23 17:34 +1000
              Re: Ubuntu package "python3" does not include tkinter lcrocker <leedanielcrocker@gmail.com> - 2013-04-22 04:18 -0700
                Re: Ubuntu package "python3" does not include tkinter rusi <rustompmody@gmail.com> - 2013-04-22 05:08 -0700
                Re: Ubuntu package "python3" does not include tkinter Chris Angelico <rosuav@gmail.com> - 2013-04-22 23:07 +1000
                Re: Ubuntu package "python3" does not include tkinter Rui Maciel <rui.maciel@gmail.com> - 2013-04-22 22:00 +0100
        Re: Ubuntu package "python3" does not include tkinter Rui Maciel <rui.maciel@gmail.com> - 2013-04-22 07:35 +0100
          Re: Ubuntu package "python3" does not include tkinter rusi <rustompmody@gmail.com> - 2013-04-22 04:16 -0700
    Re: Ubuntu package "python3" does not include tkinter Peter Otten <__peter__@web.de> - 2013-04-19 19:53 +0200
    Re: Ubuntu package "python3" does not include tkinter Terry Jan Reedy <tjreedy@udel.edu> - 2013-04-19 14:42 -0400
    Re: Ubuntu package "python3" does not include tkinter Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-20 00:05 +0000

Page 1 of 3  [1] 2 3  Next page →


#43916 — Ubuntu package "python3" does not include tkinter

Fromlcrocker <lee@piclab.com>
Date2013-04-19 10:17 -0700
SubjectUbuntu package "python3" does not include tkinter
Message-ID<e5aa7cad-9fa0-41af-a3a4-fce212b15ab9@l5g2000pbp.googlegroups.com>
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.

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?

[toc] | [next] | [standalone]


#43917

FromJoel Goldstick <joel.goldstick@gmail.com>
Date2013-04-19 13:25 -0400
Message-ID<mailman.831.1366392349.3114.python-list@python.org>
In reply to#43916

[Multipart message — attachments visible in raw view] — view raw

On Fri, Apr 19, 2013 at 1:17 PM, lcrocker <lee@piclab.com> 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.
>
> 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?
> --
> http://mail.python.org/mailman/listinfo/python-list
>

>From here: http://wiki.python.org/moin/TkInter

Does this help?

Try the correct command for your version at the Python prompt:

>>> import Tkinter # no underscore, uppercase 'T' for versions prior to V3.0

>>> import tkinter # no underscore, lowercase 't' for V3.0 and later


-- 
Joel Goldstick
http://joelgoldstick.com

[toc] | [prev] | [next] | [standalone]


#43918

Fromlcrocker <leedanielcrocker@gmail.com>
Date2013-04-19 10:30 -0700
Message-ID<955c1941-250e-4d89-ad13-6ba82717be1d@ys5g2000pbc.googlegroups.com>
In reply to#43917
Thanks, but I'm not having any trouble running tkinter, it works just
fine. I have an issue with the fact that it's optional. It reflects
badly on the language and community if we allow just anyone to call
something "Python" that doesn't meet some minimum standard of quality.
Java has its compliance tests: if your implementation doesn't pass,
you can't call it "Java". I'm asking if there's something similar for
Python, because Ubuntu's Python 3 doesn't pass the test.

[toc] | [prev] | [next] | [standalone]


#43919

FromAndrew Berg <bahamutzero8825@gmail.com>
Date2013-04-19 12:35 -0500
Message-ID<mailman.832.1366392951.3114.python-list@python.org>
In reply to#43916
On 2013.04.19 12:17, 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.
Forcing Tkinter as a dependency would result in a ton of things being installed to support it. Why should a web server using Django have X
installed and running because Python /can/ support a GUI in the standard library? It's trivial to install Tkinter if you need it, but it
would be a huge mess to try to remove it from an installation that requires it - even if you never use Tkinter. Ubuntu is far from alone
here. FreeBSD (and probably the other BSDs) and most Linux distros do something similar. There is zero reason to force Tkinter and its
dependencies on all Python users.
-- 
CPython 3.3.0 | Windows NT 6.2.9200 / FreeBSD 9.1

[toc] | [prev] | [next] | [standalone]


#43920

Fromlcrocker <leedanielcrocker@gmail.com>
Date2013-04-19 10:42 -0700
Message-ID<9ba1d90b-1a69-4e5a-8a9e-574009b0bdf3@fs2g2000pbd.googlegroups.com>
In reply to#43919
On Apr 19, 10:35 am, Andrew Berg <bahamutzero8...@gmail.com> wrote:
> On 2013.04.19 12:17, 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.
>
> Forcing Tkinter as a dependency would result in a ton of things being installed to support it. Why should a web server using Django have X
> installed and running because Python /can/ support a GUI in the standard library? It's trivial to install Tkinter if you need it, but it
> would be a huge mess to try to remove it from an installation that requires it - even if you never use Tkinter. Ubuntu is far from alone
> here. FreeBSD (and probably the other BSDs) and most Linux distros do something similar. There is zero reason to force Tkinter and its
> dependencies on all Python users.
> --
> CPython 3.3.0 | Windows NT 6.2.9200 / FreeBSD 9.1

I understand that for something like a server distribution, but Ubuntu
is a user-focused desktop distribution. It has a GUI, always. The
purpose of a distro like that is to give users a good experience. If I
install Python on Windows, I get to use Python. On Ubuntu, I don't,
and I think that will confuse some users. I recently recommended
Python to a friend who wants to start learning programming. Hurdles
like this don't help someone like him.

[toc] | [prev] | [next] | [standalone]


#43921

Fromrusi <rustompmody@gmail.com>
Date2013-04-19 10:53 -0700
Message-ID<cc8126af-b0fc-4a62-9b50-33dd0af5bd32@ys5g2000pbc.googlegroups.com>
In reply to#43920
On Apr 19, 10:42 pm, lcrocker <leedanielcroc...@gmail.com> wrote:
> On Apr 19, 10:35 am, Andrew Berg <bahamutzero8...@gmail.com> wrote:
>
> > On 2013.04.19 12:17, 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.
>
> > Forcing Tkinter as a dependency would result in a ton of things being installed to support it. Why should a web server using Django have X
> > installed and running because Python /can/ support a GUI in the standard library? It's trivial to install Tkinter if you need it, but it
> > would be a huge mess to try to remove it from an installation that requires it - even if you never use Tkinter. Ubuntu is far from alone
> > here. FreeBSD (and probably the other BSDs) and most Linux distros do something similar. There is zero reason to force Tkinter and its
> > dependencies on all Python users.
> > --
> > CPython 3.3.0 | Windows NT 6.2.9200 / FreeBSD 9.1
>
> I understand that for something like a server distribution, but Ubuntu
> is a user-focused desktop distribution. It has a GUI, always. The
> purpose of a distro like that is to give users a good experience. If I
> install Python on Windows, I get to use Python. On Ubuntu, I don't,
> and I think that will confuse some users. I recently recommended
> Python to a friend who wants to start learning programming. Hurdles
> like this don't help someone like him.

Well I guess you could take the example of kde.
kde has a kde-standard and a kde-full.
Likewise one could imagine python-standard being what is currently
called python and python-full pulling in other dependencies like
tkinter.
If there were a number of such it may even make sense, if not it looks
like overkill (to me)

[toc] | [prev] | [next] | [standalone]


#43924

FromAndrew Berg <bahamutzero8825@gmail.com>
Date2013-04-19 13:05 -0500
Message-ID<mailman.835.1366394756.3114.python-list@python.org>
In reply to#43920
On 2013.04.19 12:42, lcrocker wrote:
> I understand that for something like a server distribution, but Ubuntu
> is a user-focused desktop distribution. It has a GUI, always.
That is incorrect.
http://www.ubuntu.com/server

-- 
CPython 3.3.0 | Windows NT 6.2.9200 / FreeBSD 9.1

[toc] | [prev] | [next] | [standalone]


#43956

FromSibylle Koczian <nulla.epistola@web.de>
Date2013-04-20 18:10 +0200
Message-ID<mailman.854.1366474272.3114.python-list@python.org>
In reply to#43920
Am 19.04.2013 19:42, schrieb lcrocker:
> I understand that for something like a server distribution, but Ubuntu
> is a user-focused desktop distribution. It has a GUI, always. The
> purpose of a distro like that is to give users a good experience. If I
> install Python on Windows, I get to use Python. On Ubuntu, I don't,
> and I think that will confuse some users. I recently recommended
> Python to a friend who wants to start learning programming. Hurdles
> like this don't help someone like him.

It's _so_ easy to install an additional package on Ubuntu that that 
really shouldn't be called a 'hurdle'. Using tkinter or any other GUI 
toolkit is much more difficult for a beginner.

[toc] | [prev] | [next] | [standalone]


#44031

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2013-04-22 03:57 +0000
Message-ID<5174b515$0$29872$c3e8da3$5496439d@news.astraweb.com>
In reply to#43956
On Sat, 20 Apr 2013 18:10:58 +0200, Sibylle Koczian wrote:

> Am 19.04.2013 19:42, schrieb lcrocker:
>> I understand that for something like a server distribution, but Ubuntu
>> is a user-focused desktop distribution. It has a GUI, always. The
>> purpose of a distro like that is to give users a good experience. If I
>> install Python on Windows, I get to use Python. On Ubuntu, I don't, and
>> I think that will confuse some users. I recently recommended Python to
>> a friend who wants to start learning programming. Hurdles like this
>> don't help someone like him.
> 
> It's _so_ easy to install an additional package on Ubuntu that that
> really shouldn't be called a 'hurdle'. Using tkinter or any other GUI
> toolkit is much more difficult for a beginner.

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.



-- 
Steven

[toc] | [prev] | [next] | [standalone]


#44032

Fromrusi <rustompmody@gmail.com>
Date2013-04-21 21:10 -0700
Message-ID<5e225794-fa3c-4fb7-9ee4-1d0db3b4ba1f@fz1g2000pbb.googlegroups.com>
In reply to#44031
On Apr 22, 8:57 am, Steven D'Aprano <steve
+comp.lang.pyt...@pearwood.info> wrote:
> On Sat, 20 Apr 2013 18:10:58 +0200, Sibylle Koczian wrote:
> > Am 19.04.2013 19:42, schrieb lcrocker:
> >> I understand that for something like a server distribution, but Ubuntu
> >> is a user-focused desktop distribution. It has a GUI, always. The
> >> purpose of a distro like that is to give users a good experience. If I
> >> install Python on Windows, I get to use Python. On Ubuntu, I don't, and
> >> I think that will confuse some users. I recently recommended Python to
> >> a friend who wants to start learning programming. Hurdles like this
> >> don't help someone like him.
>
> > It's _so_ easy to install an additional package on Ubuntu that that
> > really shouldn't be called a 'hurdle'. Using tkinter or any other GUI
> > toolkit is much more difficult for a beginner.
>
> 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.
>
> --
> Steven

Yes

There is some infrastructure in debian/ubuntu (not sure what/where/
how) which behaves something like so:
$peculiar_command
peculiar_command no found but exists in package FooBar

I believe that repackaged pythons (like debian's) should be able to
hook into this system and give better error messages than

ImportError: No module named Tkinter

[toc] | [prev] | [next] | [standalone]


#44033

FromAndrew Berg <bahamutzero8825@gmail.com>
Date2013-04-21 23:24 -0500
Message-ID<mailman.896.1366604649.3114.python-list@python.org>
In reply to#44031
On 2013.04.21 22:57, 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.
I haven't worked with Ubuntu or apt-based packaging in ages, but isn't this kind of information in a description message or something
(especially in a GUI frontend)?

-- 
CPython 3.3.0 | Windows NT 6.2.9200 / FreeBSD 9.1

[toc] | [prev] | [next] | [standalone]


#44034

Fromrusi <rustompmody@gmail.com>
Date2013-04-21 21:34 -0700
Message-ID<7d7dcc2b-62e0-4f1a-b8f4-e1662437a512@ot10g2000pbb.googlegroups.com>
In reply to#44033
On Apr 22, 9:24 am, Andrew Berg <bahamutzero8...@gmail.com> wrote:
> On 2013.04.21 22:57, 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.
>
> I haven't worked with Ubuntu or apt-based packaging in ages, but isn't this kind of information in a description message or something
> (especially in a GUI frontend)?

Of course... If you know where to look. (I think that's Steven's point
in the 'you know that you have to')

For a noob getting the error
ImportError: No module named Tkinter

it may be that
- he has not installed tkinter
- he has misspelled tkinter
- he has misspelled the import statement (yeah then he'll get syntax
error or somesuch… being a noob he does not know)

I personally know that one can put 'python' in the search box in
synaptic and fish around.
The point is that the noob to python may be a noob to linux/apt also.

[toc] | [prev] | [next] | [standalone]


#44036

FromAndrew Berg <bahamutzero8825@gmail.com>
Date2013-04-22 00:13 -0500
Message-ID<mailman.898.1366607600.3114.python-list@python.org>
In reply to#44034
On 2013.04.21 23:34, rusi wrote:
> On Apr 22, 9:24 am, Andrew Berg <bahamutzero8...@gmail.com> wrote:
>> On 2013.04.21 22:57, 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.
>>
>> I haven't worked with Ubuntu or apt-based packaging in ages, but isn't this kind of information in a description message or something
>> (especially in a GUI frontend)?
> 
> Of course... If you know where to look. (I think that's Steven's point
> in the 'you know that you have to')
I meant when installing it. I forgot for a moment that Ubuntu and many other Linux distros come with Python already installed.

-- 
CPython 3.3.1 | Windows NT 6.2.9200 / FreeBSD 9.1

[toc] | [prev] | [next] | [standalone]


#44039

FromRui Maciel <rui.maciel@gmail.com>
Date2013-04-22 07:36 +0100
Message-ID<kl2lk9$qnv$2@dont-email.me>
In reply to#44031
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.


Rui Maciel

[toc] | [prev] | [next] | [standalone]


#44040

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2013-04-22 07:17 +0000
Message-ID<5174e407$0$29872$c3e8da3$5496439d@news.astraweb.com>
In reply to#44039
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

[toc] | [prev] | [next] | [standalone]


#44041

FromAndrew Berg <bahamutzero8825@gmail.com>
Date2013-04-22 03:08 -0500
Message-ID<mailman.900.1366618110.3114.python-list@python.org>
In reply to#44040
On 2013.04.22 02:17, Steven D'Aprano wrote:
> 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?
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).
-- 
CPython 3.3.1 | Windows NT 6.2.9200 / FreeBSD 9.1

[toc] | [prev] | [next] | [standalone]


#44044

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2013-04-22 09:18 +0000
Message-ID<5175005f$0$29872$c3e8da3$5496439d@news.astraweb.com>
In reply to#44041
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

[toc] | [prev] | [next] | [standalone]


#44058

FromAntoon Pardon <antoon.pardon@rece.vub.ac.be>
Date2013-04-22 14:52 +0200
Message-ID<mailman.908.1366635188.3114.python-list@python.org>
In reply to#44044
Op 22-04-13 11:18, Steven D'Aprano schreef:
> 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.
Then don't use a package system. The job of a package system is, that if
you install something, it install all dependencies that are needed to make
it work. And if, as the OP you thinks, python working, means tkinter working,
not installing tcl and not installing X, is not an option.

Your solution doesn't make sense in view of your earlier response where
you argue tkinster should be installed because it is part of the standard
combined with the advantage of having a standard library. But IMO a part
of that standard library not working, is just as harmful as part of that
standard library not being installed. From a user/programmer's point of
view the result is the same. It is unusable.

[toc] | [prev] | [next] | [standalone]


#44126

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2013-04-23 00:22 +0000
Message-ID<5175d450$0$29977$c3e8da3$5496439d@news.astraweb.com>
In reply to#44058
On Mon, 22 Apr 2013 14:52:39 +0200, Antoon Pardon wrote:

> Op 22-04-13 11:18, Steven D'Aprano schreef:
>> 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.

> Then don't use a package system. The job of a package system is, that if
> you install something, it install all dependencies that are needed to
> make it work.

No, the job of the package system is to manage dependencies. It makes no 
guarantee about whether or not something will "work".

$ sudo apt-get install rule_world
$ rule_world --start-from Australia
Error: cannot connect to US nuclear arsenal from here, you cannot rule 
the world


A joke example, of course, but a serious point. Successful installation 
doesn't necessarily mean the program will run successfully, or "work" in 
any meaningful way.

We're also glossing over what it means to be a dependency. This is not 
obvious, and in fact I would argue that X is NOT a dependency for 
tkinter, even though tkinter will not "work" without it, for some 
definition of work. I can quite happily import tkinter on a remote 
machine over ssh:

py> from tkinter.messagebox import showinfo

or do the same thing on a local machine from a non-X terminal. I haven't 
tried it, but quite possibly even on a headless machine without X 
installed at all. And why not? Tkinter is a big module, there are all 
sorts of things that I might want to access that don't actually require 
an X display. If nothing else, I can do this:

py> help(showinfo)


and read the docs. Tkinter does not actually require X to "work". It 
merely requires X in order to *display an X window*.

It's only when I actually try to do something that requires an X display 
that it will fail. I won't show the entire traceback, because it is long 
and not particularly enlightening, but the final error message explains 
exactly why it isn't working:

_tkinter.TclError: no display name and no $DISPLAY environment variable



> Your solution doesn't make sense in view of your earlier response where
> you argue tkinster should be installed because it is part of the
> standard combined with the advantage of having a standard library. But
> IMO a part of that standard library not working, is just as harmful as
> part of that standard library not being installed. From a
> user/programmer's point of view the result is the same. It is unusable.

Not at all. As I said earlier, I would expect that trying to import 
tkinter on such a system should give a meaningful error message. 
Actually, it need not even fail at import time. As I show above, I can 
happily import tkinter without an X display. I haven't tried it, but I 
expect that I can probably import tkinter without Tcl either.

Let me put this another way:

It should not matter whether I install Tcl before Python, or after 
Python, the end result should be that once both are installed, tkinter 
will be usable (provided you have an X display). To put it in Ubuntu 
terms, if I do this:

apt-get tcl
apt-get python

or this:

apt-get python
apt-get tcl

on a machine with X, tkinter should Just Work. And if I don't install 
tcl, tkinter should still import, it just won't be able to, you know, 
interface to tcl.

What we're arguing here is merely the design of the dependency graph, and 
that's a matter of taste. My design would be different from that of the 
Ubuntu folks. That's fine. If we all agreed about everything, we'd have 
nothing to argue about *wink*

But I think we can all agree that something like this is pretty crappy:


py> import Tkinter
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.5/lib-tk/Tkinter.py", line 38, in <module>
    import _tkinter # If this fails your Python may not be configured for 
Tk
ImportError: No module named _tkinter

Oh great. My Python is not configured for Tk. How does that help me? What 
do I do now? No idea. Why oh why can't we get a better class of error 
messages?




-- 
Steven

[toc] | [prev] | [next] | [standalone]


#44128

FromChris Angelico <rosuav@gmail.com>
Date2013-04-23 10:36 +1000
Message-ID<mailman.942.1366677401.3114.python-list@python.org>
In reply to#44126
On Tue, Apr 23, 2013 at 10:22 AM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> wrote:
> It's only when I actually try to do something that requires an X display
> that it will fail. I won't show the entire traceback, because it is long
> and not particularly enlightening, but the final error message explains
> exactly why it isn't working:
>
> _tkinter.TclError: no display name and no $DISPLAY environment variable

You presumably have a system to test this on. Can you try using ssh -X
to get to it, and then retry that action? It looks like you actually
have everything you need, just no display... which is exactly what
you'd get if you ssh to something that has a real GUI. Not a
dependency problem.

ChrisA

[toc] | [prev] | [next] | [standalone]


Page 1 of 3  [1] 2 3  Next page →

Back to top | Article view | comp.lang.python


csiph-web