Bug(s) in Python 3.1.1 Windows installation

A

Alf P. Steinbach

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
 
A

Alf P. Steinbach

* Alf P. Steinbach:
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).

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)
 
G

Gabriel Genellina

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",

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.
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).

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

Gabriel Genellina

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

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.
 
A

Alf P. Steinbach

* Alf P. Steinbach:
* Alf P. Steinbach:
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).

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

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):
</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?).
 
A

Alf P. Steinbach

* Gabriel Genellina:
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.

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


Cheers & hth.,

- Alf
 
A

Alf P. Steinbach

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

No, completely clean install.

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.

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

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

Sure, thanks.

But there are three reasons why I posted here. (1) I'm lazy. (2) It can help
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
 
M

Mark Hammond

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

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.
(2) Failure to set up PATH.

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.
Even after setting up a correct PATH Tkinter does not work:

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

HTH,

Mark
 
A

Alf P. Steinbach

* Mark Hammond:
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.

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

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.

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. :)

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

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
 
D

David Robinow

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.

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

Alf P. Steinbach

* David Robinow:
It's not a *nix port. It's multiplatform and it works fine.

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

As you've
been told before, ActivePython "is" cpython.

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.

That said -- which is all about your comments, not about Python -- I rather like
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.
 
J

John Machin

(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

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/library/tkinter.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.


[snip]
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.

but the tkinter module is bundled
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

Which documentation?

just be used, and it could just be used with ActivePython. Here the novice has

ActivePython 2.X or 3.X?
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.

PyPI is for third-party modules and packages.

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.
 >>> import _tkinter
 >>> import Tkinter
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?).

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.'C:\\python31\\lib\\tkinter\\__init__.py'

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

Alf P. Steinbach

* John Machin:
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/library/tkinter.html
... in general, see the whatsnew docs that I pointed you at.

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.

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.

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.


[snip]
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.

but the tkinter module is bundled
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

Which documentation?

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).

ActivePython 2.X or 3.X?

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

Of course it works just fine in 3.x when one writes lowercase "tkinter".


PyPI is for third-party modules and packages.

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

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.
import _tkinter
import Tkinter
Traceback (most recent call last):
</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?).

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.'C:\\python31\\lib\\tkinter\\__init__.py'

Hey, that's very useful! :)

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

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
 
G

Gabriel Genellina

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

The Python installer from python.org does NOT add .py and .pyw to PATHEXT;
the ActivePython one does.
(3) Tkinter not bundled, misleading & incomplete documentation.
However, running Tkinter based programs does *not* work:
import Tkinter

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-hello-world-program
clearly says "tkinter" instead of "Tkinter"
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.

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

Alf P. Steinbach

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

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 registry entry
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. ;-)

(3) Tkinter not bundled, misleading & incomplete documentation.
However, running Tkinter based programs does *not* work:
import Tkinter

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-hello-world-program

clearly says "tkinter" instead of "Tkinter"
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.

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

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 asked 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 enough
to go on with things after that), and the main problem with using Tkinter is the
name change, with the documentation that one would use (referenced from the main
3.1.1 documentation which only provides a little kick-off starter intro) still
using the old name and with, of course, no hint about version dependence.


Cheers,

- Alf
 
E

Ethan Furman

Mark said:
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

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

~Ethan~
 
E

Ethan Furman

Alf said:
* Ethan Furman:
Looks like in 3.x the name was changed to tkinter.

~Ethan~


That works! <g>

Thanks. But, where I can find information about how "import" now works?
I mean there's no *file* named [tkinter.*] anywhere, so I suspect it
looks in the [tkinter] directory or perhaps uses some setup file's name
association or?


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~
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top