mentby.com
Blog | Jobs | Help | Signup | Login

Bug(s) in Python 3.1.1 Windows installation



Hi.

Or, to whomever this concerns... ;-)

I thought it would be prudent to install 3.1.1 for Windows from scratch, so I
uninstalled everything (CPython, ActivePython), and then installed Python 3.1.1.

In the "Advanced" option I told the installer to compile packages.

The compiler then found a few syntax errors apparently in some text conversion
test programs, and finally a message box popped up saying that "There is a
problem with this Windows Installer Package",

      http://imgur.com/N6Pbp

and the main installation dialog then reported "Python 3.1.1 installer ended
prematurely. [...] Your system has not been modified".

      http://imgur.com/0kzMS.png

OK, I'll try again /without/ asking it to compile. I'm just reporting this so
that whoever needs to know knows (including maintainers and people wanting to
install this).

Cheers,

- Alf


Alf P. Steinbach Wed, 28 Oct 2009 15:21:50 -0700

* Alf P. Steinbach:

Hm, the installer forgot to clean up, leaving lots of files, so contrary to the
dialog's final message the system had been modified.

Cheers,

- Alf (now going to try this again without asking it to compile)


Alf P. Steinbach Wed, 28 Oct 2009 15:37:30 -0700

En Wed, 28 Oct 2009 19:18:48 -0300, Alf P. Steinbach <alfps*******>
escribió:

Did you install it over an existing directory, that might contain modules
intended for a previous version, e.g. c:\python?

Even if you uninstall Python, the uninstaller removes *only* the files
*it* copied; everything else is left alone. This includes
modules/libraries/packages that you may have installed in the past.
Libraries written for any 2.x version are not compatible with the new 3.x
syntax; if any of those libraries exist in the directory where you install
3.1.1, you get an error like yours.

The best place to report bugs is  http://bugs.python.org/

--
Gabriel Genellina

-- http://mail.python.org/mailman/listinfo/python-list


Gabriel Genellina Wed, 28 Oct 2009 16:25:32 -0700

En Wed, 28 Oct 2009 19:30:13 -0300, Alf P. Steinbach <alfps*******>
escribió:

If those files are third-party libraries, this confirms my previous post.
It's not the 3.1.1 installer that forgot to clean up, but files from a
previous 2.x installation.

--
Gabriel Genellina

-- http://mail.python.org/mailman/listinfo/python-list


Gabriel Genellina Wed, 28 Oct 2009 16:31:55 -0700

* Alf P. Steinbach:

OK, after failing the Python 3.1.1 installer did manage to leave an uninstaller
for itself, and I ran that.

(1) Sluggish installer (about 600x slower than necessary)

What should be a simple removal of files and registry keys taking all of 1.5
seconds or so took about 10 minutes. I've experienced this before with
Microsoft's installer technology (MSI). Apparently it utilizes the infamuous
Microsoft "never use an O(n) algorithm where an O(n^2) or O(n^3) algorithm will
do on a sufficiently fast machine" strategy.

So I suggest switching to some other more light-weight installer technology.

(2) Failure to set up PATH.

Without asking the Python 3.1.1 installer to compile packages it now installed,
but it failed to set up the PATH environment variable (the ActivePython
installation also failed to do that, but I worked around it in my writings by
just not using the "python" command yet, referring to that in a footnote).

The installer did manage to do the rest of that part correctly: file
associations and PATHEXT variable.

In new command interpreter instance:

<example of="what the Python 3.1.1 installer did manage to do correctly">
C:\Documents and Settings\Alf> echo %pathext%
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.CJS;.JS;.JSE;.WSF;.WSH;.RB;.RBW;.tcl;.py;.pyw

C:\Documents and Settings\Alf> assoc | find /i "pyt"
.py=Python.File
.pyc=Python.CompiledFile
.pyo=Python.CompiledFile
.pyw=Python.NoConFile

C:\Documents and Settings\Alf> ftype | find /i "pyt"
Python.CompiledFile="C:\Program Files\cpython\python31\python.exe" "%1" %*
Python.File="C:\Program Files\cpython\python31\python.exe" "%1" %*
Python.NoConFile="C:\Program Files\cpython\python31\pythonw.exe" "%1" %*
</example>

(3) Tkinter not bundled, misleading & incomplete documentation.

With the file associations in place (the installer managed to do that) running
console programs works fine.

However, running Tkinter based programs does *not* work:

<code filename="ellipse.pyw">
import Tkinter

window = Tkinter.Tk()
window.title( "A fixed size ellipse..." )
window.geometry( "350x200" )            # Client area size, not window size.
window.resizable( width = 0, height = 0 )

canvas = Tkinter.Canvas( window, bg = "white" )
bbox = 2, 2, 347, 197                   # Pixel coors left, top, right, bottom
canvas.create_oval( *bbox, fill = "PeachPuff" )
canvas.pack()                           # Fill the entire client area, please.

window.mainloop()                       # Process events until window is closed.
</code>

<example of="Tkinter does not work after installation">
C:\Documents and Settings\Alf> python ellipse.pyw
'python' is not recognized as an internal or external command,
operable program or batch file.

C:\Documents and Settings\Alf> "C:\Program Files\cpython\python31\python.exe"
ellipse.pyw
Traceback (most recent call last):
   File "ellipse.pyw", line 1, in <module>
     import Tkinter
ImportError: No module named Tkinter
</example>

Even after setting up a correct PATH Tkinter does not work:

<example of="Tkinter doesn't work even with correct PATH">
C:\Documents and Settings\Alf> set path=%path%;C:\Program Files\cpython\python31

C:\Documents and Settings\Alf> python ellipse.pyw
Traceback (most recent call last):
   File "ellipse.pyw", line 1, in <module>
     import Tkinter
ImportError: No module named Tkinter
</example>

Checking I find that while there is a Tkinter folder there is no file
[Tkinter.py] in this installation, i.e. the Tkinter module is not bundled with
this distribution.

That's bad news for any novice wanting to start learning the language: a main
"battery" is missing! The documentation gives the impression that Tkinter can
just be used, and it could just be used with ActivePython. Here the novice has
to figure out not only that it isn't there, but also how to get it!

Checking <url:  http://pypi.python.org/pypi/>,  the package index, nope, no
Tkinter there.

Typing "tkinter" in the Firefox address bar leads to <url: http://wiki.python.org/moin/TkInter>,  and it has a recipe for checking for
Tkinter support/installation:

<checking results>
Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
ImportError: No module named Tkinter
</checking results>

The recipe now calls for adding path to directory with [Tkinter.py], but as
mentioned no such file in this installation...

Cheers,

- Alf

PS: This was not unexpected. It was exactly why I earlier didn't even look at
CPython (umpteen bad experiences with *nix ports) but used ActivePython. I'm
hopeful that I will find where Tkinter resides on the net, but hey, it should at
least be documented, up front I mean (it's possibly mentioned somewhere, yes?).


Alf P. Steinbach Wed, 28 Oct 2009 17:13:22 -0700

* Gabriel Genellina:

No, those files were the 3.1 installation directory   subdirectories and fles.

Cheers & hth.,

- Alf
-- http://mail.python.org/mailman/listinfo/python-list


Alf P. Steinbach Wed, 28 Oct 2009 17:16:37 -0700

* Gabriel Genellina:

No, completely clean install.

No, after uninstalling previous stuff I manually cleaned up remains (to the
point of removing left over file extensions in PATHEXT).

Sure, thanks.

But there are three reasons why I posted here. (1) I'm lazy. (2) It can hep
others. (3) Faster response times, including helpful responses like yours (=
and
yes it would really have been helpful if that was the problem, so thanks! -) )

Cheers,

- Alf
-- http://mail.python.org/mailman/listinfo/python-list


Alf P. Steinbach Wed, 28 Oct 2009 17:20:39 -0700

Thanks for the suggestion, but I expect we will stick with MSI even with
its shortcomings.  Using MSI files has significant other advantages,
particularly in "managed" environments.

This is by design.  If you really care passionately about this, you
should be able to find a number of discussions here, in python-dev and
in the python bug tracker.

One example of why the current behaviour is useful is that many people
install multiple Python versions side-by-side and a "last installed
wins" strategy isn't a great option.

I suspect this will be a Python 3.x issue - you probably want to stick
with 2.x.

HTH,

Mark


Mark Hammond Wed, 28 Oct 2009 17:23:19 -0700

* Mark Hammond:

Hm, yes, isn't that always so...

This rationale is then inconsistent with the installer setting up file
associations (the same argument should apply there if it was valid).

But please don't remove the setting up of file associations, for it would then
require any novice to learn about paths and directories and the Windows registry
and whatnot before even creating first program.

A reasonable solution is, I think, to check and give the user the choice, with
default to Just Do It if there is no apparent conflict. :-)

Ethan Furman suggested that in Python 3.x the name was changed to all lowercase
"tkinter", and that worked...

I don't understand how it works, yet, since there's no file [tkinter.*]
anywhere, but, it works! :-)

Summarizing the main differences 2.6 -> 3.1.1 that I know of so far: print is
now a function (nice), "/" now always produces float result (unsure about that,
it must surely break a lot or even most of existing code?), xrange() has been
removed and range() now works like old xrange().

Cheers,

- Alf


Alf P. Steinbach Wed, 28 Oct 2009 18:03:58 -0700

It's not a *nix port. It's multiplatform and it works fine. As you've
been told before, ActivePython "is" cpython.


Drobinow Wed, 28 Oct 2009 18:29:18 -0700

* David Robinow:

Your "works fine" is in blatant contradiction with reality, as reported here.

Thanks for that point of view, but ActivePython just works without any hassle,
while CPython does not.

As far as I'm concerned you can call the beast whatever you want, e.g.
"multiplatform". But don't expect me to use your terminology just to please you
and make it seem nicer than it is. I think that's an outrageous request, on the
same level of outrageousness as the denial of reality that you engaged in above.

the 3.1.1 thing so far. It could do with a much better installer, the packaging,
which is what I tested now. But since 2.6 is a transitional ease-the-porting
version, 3.x is automatically a much more clean language, and it seems better.

Cheers & hth.,

- Alf

PS: Please don't mail me copies of your replies. This time it made me first
e-mail and then have to copy that for the in-group reply. It does fit in with
your denial of reality and insistence that others should use the terms that you
like the best, the non-thinking or trolling (not much difference in practice)
approach to dealing with things, but even if it fits so well please don't do it.


Alf P. Steinbach Wed, 28 Oct 2009 19:01:51 -0700

What documentation are you reading? As you are running Python 3.1, you
might like to consider reading 3.1 documentation. Many things have
been changed from 2.X, including renaming unconventionally named
modules and packages. In particular see  http://docs.python.org/3.1/librarytkinter.html
... in general, see the whatsnew docs that I pointed you at.

If you are trying to run 2.X code under 3.1, don't expect it to work
straight away. Find "2to3" in the docs.

but the tkinter module is bundled

Which documentation?

ActivePython 2.X or 3.X?

PyPI is for third-party modules and packages.

Yes. You'll find that tkinter resides also on your hard disk (unless
you chose not to install it).

Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit
(Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.

Didn't you do a search of your hard disk for "Tkinter"?

-- http://mail.python.org/mailman/listinfo/python-list


John Machin Wed, 28 Oct 2009 21:31:57 -0700

* John Machin:

Thanks. I wasn't expecting that the names used to access some library had
changed just because the core language had been changed, and I didn't notice
this little change of letter case  --  but Ethan Furman set me straight on that
earlier, as I reported else-thread. I'm new to the language.

Thanks again!

I don't see how "2to3" can fix up "/" operators without having static type
information. In the case of integer args "/" should be replaced with "//" (as I
understand it), while for floats it should be left alone as-is. Hm.

It seems to me that Pyrex has demonstrated that declarations *can* be combined
sort of naturally with the rest of the language. What I miss most is the kind of
  force-use-of-declarations directive like Perl "use strict" or VBScript "option
explicit". Of course that would require some way to declare variables, at least
their names... But perhaps this is already in 3.x? I'll probably find out.

I see that the docs installed with 3.1.1 uses all lowercase in the code.

But the tutorials etc. on the net, referenced from the 3.1.1 documentation, have
not been updated to mention that they're not version-inpendent any longer.

E.g. <url:  http://infohost.nmt.edu/tcc/help/pubs/tkinter/> > (which says it is a
reference), and others referenced from the 3.1.1 documentation (I think the
3.1.1 documentation should clearly state that the referenced get-the-details
external documentation is for an earlier version of Python).

2.6, I couldn't find any later ActivePython version.

Does that mean that Tkinter is *not* third-party, but now part of the language
like part of its standard library?

Hey, that's very useful! :-)

Yes, it only found a folder and some DLLs, I think it was.

But given the filename you showed above I now found out about "packages" in Python.

I guess it's the stumble-upon principle at work. <g>

Cheers,

- Alf


Alf P. Steinbach Wed, 28 Oct 2009 22:52:29 -0700

En Wed, 28 Oct 2009 21:06:03 -0300, Alf P. Steinbach <alfps*******>
escribió:

The Python installer from python.org does NOT add .py and .pyw to PATHEXT;
the ActivePython one does.

I suggest you read the documentation for the Python version you're using,
not any other at random... http://docs.python.org/3.1/library/tkinter.html#a-simple-hel[..]
clearly says "tkinter" instead of "Tkinter"

Read in the tutorial the section about packages. tkinter is a package, not
a module.

--
Gabriel Genellina

-- http://mail.python.org/mailman/listinfo/python-list


Gabriel Genellina Wed, 28 Oct 2009 23:04:06 -0700

* Gabriel Genellina:

That's possible.

Or possibly it's a bug in Windows Explorer, caching the registry entry; I
discovered after writing the above that the change was not in the registryentry
itself but only in the environments of new processes, no matter how started.

It's difficult to say what the causes are, this program or that, when two
programs that both demonstrably have some bugs interact. ;-)

Thanks for trying to help.

But this has already been discussed else/up-thread.

Anyways, the main problem with the installation is that it fails when aske to
compile (it seems to be a double bug: that some of the source code files to
compile have syntax errors, and that the installation program isn't smart nough
to go on with things after that), and the main problem with using Tkinter s the
name change, with the documentation that one would use (referenced from th main
3.1.1 documentation which only provides a little kick-off starter intro) sill
using the old name and with, of course, no hint about version dependence.

Cheers,

- Alf
-- http://mail.python.org/mailman/listinfo/python-list


Alf P. Steinbach Thu, 29 Oct 2009 00:01:59 -0700

Looks like in 3.x the name was changed to tkinter.

~Ethan~


Ethan Furman Thu, 29 Oct 2009 09:26:55 -0700

Alf, apologies for e-mailing you directly: I hit Reply instead of
Reply-to-all.

Try searching the archives -- there have been many discussions about
import, and a few about import in 3.x.

~Ethan~


Ethan Furman Thu, 29 Oct 2009 11:35:52 -0700



Related Topics

Post a Comment