Re: Ubuntu package python3 does not include tkinter
in 695509 20130422 081727 Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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. trivially small? 30 years ago a small mainframe only had 2MB. -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
On Tue, Apr 23, 2013 at 3:33 PM, Bob Martin bob.mar...@excite.com wrote: in 695509 20130422 081727 Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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. trivially small? 30 years ago a small mainframe only had 2MB. 30 years ago, people weren't using Tk. We've moved on beyond worrying about the odd kilobyte of space. (Also, I think you're talking RAM, and Steven was talking hard disk. Systems can easily have another SI unit of disk than memory.) ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
Steven D'Aprano wrote: Nobody forces you to do anything. Python is open source, and the source code is freely available. That goes both ways, with the added benefit that python-tkinter is already available in distro's official repositories. If you want to install it, go for it. Nothing stops you. If you don't then you aren't forced to install half the packages in the repository just to have a python interpreter in your system. Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
Chris Angelico wrote: 30 years ago, people weren't using Tk. And after 30 years gone by, some people still don't use Tk, let alone Tkinter. There is absolutely no reason to force them to install that if they don't need to. We've moved on beyond worrying about the odd kilobyte of space. That must be reason why you are the only one complaining about that. Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
Steven D'Aprano wrote: No, the job of the package system is to manage dependencies. It makes no guarantee about whether or not something will work. The purpose of establishing dependencies is to guarantee that once a software package is installed, all the necessary components needed for it to run properly are already present in the system or can be installed automatically. http://en.wikipedia.org/wiki/Dependency_hell Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
On 2013.04.23 00:49, Steven D'Aprano wrote: Obviously you cannot display an X window without X, well duh, but merely importing tkinter doesn't require an X display. Importing it doesn't. Doing anything useful with it, however, does. Would you consider the engine an optional part of a car? After all, the radio would still work and you can put things in the glove compartment. We just disagree on where to break the packages up. We disagree on what a dependency is. I say a dependency is something required in order to have any functionality that is not defined as optional or extra by the author(s). You say it's anything required in order to initialize, even if there is little to no actual functionality. Perhaps you are fond of hunting down components to make something work, but most people would expect a packaging system to automatically install whatever is required to make the software they want to use do what it is supposed to. Or perhaps you had a dummy package in mind that would automatically pull in Tcl/Tk and X and whatever else is required to make tkinter draw things on a screen as a convenience. Of course, that brings us back to the OP's problem... Since Linux distros already include whatever third-party software they see fit as part of their base (or have the OS installer install whatever the user specifies during installation), why not have desktop configurations include tkinter by default when installing? -- CPython 3.3.1 | Windows NT 6.2.9200 / FreeBSD 9.1 -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
On Tue, Apr 23, 2013 at 4:48 PM, Rui Maciel rui.mac...@gmail.com wrote: Chris Angelico wrote: 30 years ago, people weren't using Tk. And after 30 years gone by, some people still don't use Tk, let alone Tkinter. There is absolutely no reason to force them to install that if they don't need to. Agreed; my preference is GTK, when I do GUI work. We've moved on beyond worrying about the odd kilobyte of space. That must be reason why you are the only one complaining about that. I'm not. ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
On Apr 23, 11:44 am, Rui Maciel rui.mac...@gmail.com wrote: Steven D'Aprano wrote: Nobody forces you to do anything. Python is open source, and the source code is freely available. That goes both ways, with the added benefit that python-tkinter is already available in distro's official repositories. If you want to install it, go for it. Nothing stops you. If you don't then you aren't forced to install half the packages in the repository just to have a python interpreter in your system. Rui Maciel Collecting together what are the conflicting principles - 1 Fail early Fail fast 2 Good error messages 3 No crap 4 A working system that is easily upgradable and keeps working 5 Package system permissive allows wide variation of package combinations 6 Package system strict Disallows error-prone situations/combinations 7 Easy on learners/noobs -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
lcrocker wrote: I understand that for something like a server distribution, but Ubuntu is a user-focused desktop distribution. It has a GUI, always. Irrelevant. 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. Nonsense. No one is keeping anyone off tkinter. If you want it, install it. There are official packages in the repositories such as python-tk and python3-tk. If someone else doesn't want them then they aren't forced to pack their Ubuntu systems with more cruft. There's nothing worse than being forced to install piles of irrelevant and useless stuff as a dependency to a fundamental package. I recently recommended Python to a friend who wants to start learning programming. Hurdles like this don't help someone like him. If your friend believes that having to do an extra pair of clicks or typing sudo apt-get install python-tk is an unbeatable hurdle then your friend's computer skills are awfully lacking and he won't have much success learning how to write programs. Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
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 -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
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 -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
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 -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
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 -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
On Apr 21, 11:36 pm, Rui Maciel rui.mac...@gmail.com 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'm a programmer, I installed Tkinter, and use it. I'd like to deploy programs written with it to others. **Those** people know nothing about it, and **shouldn't have to**. I've given them a program in Python, they have Python, but it doesn't run, and doesn't give them a helpful error. They'll probably just blame me and move on. Not every Python user is a programmer. If I write a program in Java, any user with Java installed can run it. As it stands, that's no true for Python. That's not good PR for the cause. -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
On Apr 22, 11:35 am, Rui Maciel rui.mac...@gmail.com wrote: lcrocker wrote: I recently recommended Python to a friend who wants to start learning programming. Hurdles like this don't help someone like him. If your friend believes that having to do an extra pair of clicks or typing sudo apt-get install python-tk is an unbeatable hurdle then your friend's computer skills are awfully lacking and he won't have much success learning how to write programs. There are two worldviews here and they are as far as far can be. Its good to see them before arguing. 1. python as a standalone language 2. python as part of an (OS-related) ecosystem In windows python may or may not exist. And if it exists and I go inside the python directories and start messing around -- deleting some files, modifying others etc -- what will happen? Nothing much. My python programs will stop working. Presumably if I reinstall, it will be fine thereafter. What about linux? As an experiment I just tried $ aptitude purge python #Noobs BEWARE of that command and aptitude was too confused to give me a coherent report Tried then $ aptitude purge python2.7 The list of packages that it would purge was in hundreds. Heres a small sample of what would go: Firstly there are all the python-* packages. This is obvious. Not so obvious that some like python-csound were probably installed by me. Others like python-debian are needed for the basic health and functioning of the system. And besides these there are a pile of others that have no relation to python. A sample: asciidoc, bzr, dia, eog, gcj-*, gdb(!!), gimp, gnome-* (about 20 of these) printconf… So python is completely optional in windows. It is a part of the infrastructure on linux Messing with it is almost like saying: I dont see what that vmlinuz file is doing in /boot. So I removed it. Coming to the OP question: a. The python that PSF provides is suitable for learning python b. The python that linux distros provide is part of the wireframe on which the system rests. b may be derived from a but they are hardly the same. They may look very similar but their intents are quite different. So when you say If your friend believes that having to do an extra pair of clicks or typing sudo apt-get install python-tk is an unbeatable hurdle then your friend's computer skills are awfully lacking and he won't have much success learning how to write programs. Its all correct what you say. You wont have too many people learning from you if thats how you say it. Remember that the difference between an expert and a noob is rarely a question of intelligence or diligence. Its just some boring trivial mountain of data that the expert has picked up over time -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
On Apr 22, 4:18 pm, lcrocker leedanielcroc...@gmail.com wrote: On Apr 21, 11:36 pm, Rui Maciel rui.mac...@gmail.com 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'm a programmer, I installed Tkinter, and use it. I'd like to deploy programs written with it to others. **Those** people know nothing about it, and **shouldn't have to**. I've given them a program in Python, they have Python, but it doesn't run, and doesn't give them a helpful error. They'll probably just blame me and move on. Not every Python user is a programmer. If I write a program in Java, any user with Java installed can run it. As it stands, that's no true for Python. That's not good PR for the cause. On the whole agree -- except for the java part -- maybe you've not heard of 'jar hell'? On the whole easy-deployability without losing easy-programmability is a major research issue. See this for someone choosing C++ over Lisp http://comments.gmane.org/gmane.comp.finance.ledger.general/1955 -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
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. -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
On Mon, Apr 22, 2013 at 9:18 PM, lcrocker leedanielcroc...@gmail.com wrote: On Apr 21, 11:36 pm, Rui Maciel rui.mac...@gmail.com 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'm a programmer, I installed Tkinter, and use it. I'd like to deploy programs written with it to others. **Those** people know nothing about it, and **shouldn't have to**. I've given them a program in Python, they have Python, but it doesn't run, and doesn't give them a helpful error. They'll probably just blame me and move on. Not every Python user is a programmer. If I write a program in Java, any user with Java installed can run it. As it stands, that's no true for Python. That's not good PR for the cause. If you're deploying only to Debian-based Linuxes (such as the Ubuntu you mentioned originally), then it may be worth distributing your program as a .deb file and declaring all the appropriate dependencies (which would then include python3-tk). Alternatively, just put an apt-get install python3-tk into your install script (which is what I do for internal deployments - if you need package XYZ for program Foo, inst-foo will install XYZ), or simply tell people they need to install it. How do you make sure they even have a Python 3.x? Whatever you do to ensure that, just add python3-tk to it. ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
lcrocker wrote: I'm a programmer, I installed Tkinter, and use it. I'd like to deploy programs written with it to others. **Those** people know nothing about it, and **shouldn't have to**. They don't need to. The only person that needs to know what he is doing is you. You want to distribute a software package? Package it. Learn the very basics and set python-tkinter as a dependency. http://wiki.debian.org/Packaging Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
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. I'm not worried about that. No one should be forced to install crap that they don't use or will ever need, no matter how great the average HD capacity is nowadays. Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
On Mon, 22 Apr 2013 22:09:14 +0100, Rui Maciel wrote: 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. I'm not worried about that. No one should be forced to install crap that they don't use or will ever need, no matter how great the average HD capacity is nowadays. Nobody forces you to do anything. Python is open source, and the source code is freely available. Feel free to hand-optimize your Python installation, selecting carefully each and every module, class, and function in the standard library so that only the ones you absolutely know you will need to use are installed, using your godlike powers of precognition to foresee exactly what you need in seventeen months from now and what is crap that you will never need. Good luck with that. I look forward to hearing about the results. -- Steven -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
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:
Re: Ubuntu package python3 does not include tkinter
On Tue, Apr 23, 2013 at 10:22 AM, Steven D'Aprano steve+comp.lang.pyt...@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 -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
On 2013.04.22 19:22, Steven D'Aprano 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 So you want to go from this won't work because it's not installed to this won't work, and it there could be a hundred different reasons why? tkinter's main function is to display something on a display. To say that displaying something is an optional feature is absurd. You can install this, but your package manager won't pull in any dependencies because a few minor things will work without them. If you want it to actually do what it was made for, you need to install them yourself. Much bigger problem than the OP's, no? -- CPython 3.3.1 | Windows NT 6.2.9200 / FreeBSD 9.1 -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
On Apr 23, 5:22 am, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: 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: Yes the crux of the matter is what it means 'to work' and therefore 'to not work' Lets say my car is 'not working' On further investigation its found that the petrol tank is empty. A case could be made for either case: 'it (the car) working' or 'its not working' To the extent that pragmatically 'not working' is attended by a mechanic, its not in that category To the extent that (even more pragmatically) I missed an important appointment, its in that category Both of which gloss over the fact that after filling the petrol it may still not work. So to conclude: since I could not check, its vacuously working is more problematic than the contrary since I could not check, its vacuously not working Package systems need to 'federate' so to speak workingness from a zillion packages to the whole system. The problem is that workingness is peculiar to each package. Therefore it seems reasonable to me to ask of a package system that - it allows a maximum number of different configurations for different requirements ('without crap') - it disallows all kinds of misconfigured/non-working systems -- therefore conservative dependencies are good - the above subject to reasonable best efforts -- so dont cater to fringe pathological cases (like I want Tkinter but not X) BTW I suggested earlier that python could have something like KDE (Kde- full and a smaller Kde-standard). Just checked that python already has python2.7 and python2.7-minimal where the description of the latter says: it can be used in the boot process for basic tasks -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
On Tue, 23 Apr 2013 10:36:38 +1000, Chris Angelico wrote: On Tue, Apr 23, 2013 at 10:22 AM, Steven D'Aprano steve+comp.lang.pyt...@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. I didn't say it was a dependency problem. I'm just demonstrating that it is possible for tkinter code to fail even if all the dependencies are met; and on the other hand, it is useful to be able to import tkinter even if you cannot display any tkinter windows. -- Steven -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
On Tue, Apr 23, 2013 at 2:03 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Tue, 23 Apr 2013 10:36:38 +1000, Chris Angelico wrote: On Tue, Apr 23, 2013 at 10:22 AM, Steven D'Aprano steve+comp.lang.pyt...@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. I didn't say it was a dependency problem. I'm just demonstrating that it is possible for tkinter code to fail even if all the dependencies are met; and on the other hand, it is useful to be able to import tkinter even if you cannot display any tkinter windows. Sure. But I don't know that the situation you're seeing is the same as the one you'd see if you install tkinter without tk. ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
On Mon, 22 Apr 2013 19:47:26 -0500, Andrew Berg wrote: On 2013.04.22 19:22, Steven D'Aprano 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 So you want to go from this won't work because it's not installed to this won't work, and it there could be a hundred different reasons why? No, that's not what I said. I want to go from: this won't work because it's not installed, and I have no idea how to install it or what dependencies are needed, and even when I meet all the dependencies and install it, it might still not work to: this won't work, and here are the reasons why. Splitting tkinter out into an extra package doesn't buy you much, if anything. Here is the error I get on Debian when I try importing tkinter: Traceback (most recent call last): File string, line 1, in module File /usr/lib/python3.1/tkinter/__init__.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 This implies that the pure Python parts of tkinter are already installed. It's just the magic _tkinter module which isn't included. (Also, many points for actually telling me what I need to do to fix the problem.) tkinter's main function is to display something on a display. To say that displaying something is an optional feature is absurd. Of course it is optional. Python will run on headless systems, or before X starts up, or on systems where there is no X. Importing tkinter works before X starts up. There's *no reason why* importing tkinter ought to fail before X starts up. Obviously you cannot display an X window without X, well duh, but merely importing tkinter doesn't require an X display. You can install this, but your package manager won't pull in any dependencies because a few minor things will work without them. If you want it to actually do what it was made for, you need to install them yourself. Much bigger problem than the OP's, no? Not necessarily bigger, just different. I don't see why apt-get install python-tk is considered too trivial to worry about, but apt-get install tcl is considered a much bigger problem. So long as the error tells you what to do, they're both more or less equally hard. Or easy. We agree on the conditions needed to display tkinter GUI windows: - you must have Python - and the tkinter package - and the _tkinter module - and Tk/Tcl - and X (and an OS, and a computer, and electricity, but we can take them as given). We just disagree on where to break the packages up. Debian appears to do this: (Python tkinter) (_tkinter) (Tk/Tcl) (X) Ubuntu appears to do this, I think: (Python) (tkinter _tkinter) (Tk/Tcl) (X) I'm suggesting there's no real harm in doing this: (Python tkinter _tkinter) (Tk/Tcl) (X) for standard desktop installs, and some minor advantages. -- Steven -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
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 -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
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 -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
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 -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
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. -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
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 -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
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. -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
On Fri, Apr 19, 2013 at 1:17 PM, lcrocker l...@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 -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
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. -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
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 -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
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. -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
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. 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? Thank you for bringing this criminal offense to our attention. Right now a PSU team is readying their black helicopters to get Mr Shuttleworth and his accompli -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
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) -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
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 -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
On 4/19/2013 1:17 PM, lcrocker wrote: Am I mistaken in my belief that tkinter is a non-optional part of the Python language? Yes. The PSF CPython Windows installer makes installation of tcl/tk/tkinter optional. The build files will compile and build Python without tkinter and without other modules that depend on other c libraries (example, lzma). I believe one can build python 2 without unicode, which is much more 'core' than the Tkinter module. 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. I hope it was done politely ;-). Overall, Ubuntu is relatively advanced in moving to new versions. I believe I read that they are hoping to make 3.3 the default Python as soon as possible. -- http://mail.python.org/mailman/listinfo/python-list
Re: Ubuntu package python3 does not include tkinter
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 -- http://mail.python.org/mailman/listinfo/python-list