[Tutor] Trouble installing Python on Win7 (not a valid Win 32 app)

Marc Tompkins marc.tompkins at gmail.com
Tue Nov 15 11:52:52 CET 2011


On Mon, Nov 14, 2011 at 7:09 PM, Wayne Watson
<sierra_mtnview at sbcglobal.net>wrote:

>
> On 11/14/2011 6:17 PM, Marc Tompkins wrote:
>
> On Mon, Nov 14, 2011 at 4:55 PM, Wayne Watson <
> sierra_mtnview at sbcglobal.net> wrote:
>
>>
>> On 11/14/2011 4:04 PM, Marc Tompkins wrote:
>>
>> On Mon, Nov 14, 2011 at 4:00 PM, Wayne Watson <
>> sierra_mtnview at sbcglobal.net> wrote:
>>
>>>  I do not see Python listed there. I see Word Pad, Winamp, Paint, ...
>>>
>>> I'm at CP/All CP Items/Default prgrms/Set Defaults
>>>
>>
>> My bad.  It's Control Panel\Programs\Default Programs\Set Associations.
>>
>> (I could be wrong, but wasn't this all in one place in previous
>> versions...?)  Anyway, scroll down to .py/.pyc/.pyo/.pyw, and I bet you'll
>> find it pointing to a no-longer-valid installation.
>>
>>   py is listed as idle.pyw
>>
> This is NOT the default behavior (the default is python.exe) - I suspect
> you must have changed this for convenience when you first installed your
> old version of Python.
>
>
>>  pyw as pythonw.exe (no console)
>> pyc/pyo as python.exe.
>>
>
>   Whoops, pyo/c  are compiled python file.
>

"Compiled" doesn't mean "standalone".  They still have to be opened with
the Python interpreter (python.exe).


>
> It's stupid and irritating, but Windows only gives you the executable name
> - not the path.  Out of curiosity, does it show you the correct icons, or
> does it show you some generic Windows program icon, or something broken?
>
> The icons look python-ish.  I just used Win7 magnifier. Py looks like a
> window with a red spot on the left and blue one on the right.  pyc looks
> like a blue and a yellow snake of some sort one top of one another.
>

It was just curiosity - having normal-looking icons is no guarantee of
success...

>
> I tried adding python25 to the path as suggested by Wayne Werner. It had
> no affect.
>

"Path" can refer to the location of a particular file, or to the "search
path."

The sense I intended means the actual location of that file; on my machine
I have several versions of python.exe in different places (C:\cygwin\bin,
C:\Program Files (x86)\Inkscape\python, C:\Python27) but the only one that
matters for our current purpose is the one pointed to by the entry in
Default Programs - and the path to that one is "C:\Python27\python.exe".

Wayne was referring to the "search path" - also usually shortened to just
"path".  When you type something at the command prompt, Windows (or DOS, or
Linux, or whatever) tries to match it against its list of built-in
commands; if it's not a match, then it looks for matching executable files
in each of the folders in the search path*, and runs the first match it
finds; if it doesn't find a match, you get an error message.
*In DOS and Windows, the current working directory is tried before the
search path; in *nixes, you need to prepend "./" if you want to run a file
in the current folder.

If you can open a command prompt and go to C:\Temp (or some other arbitrary
folder), type "python", and get the Python prompt, then your search path is
working properly.

The default program/file association in Windows short-circuits the search
path; you specify exactly which executable, in what specific location, you
want Windows to use to open certain types of files.  That's why Wayne's
advice had no effect.

>
> In any case, click "Change program...", then "Browse" to the current
> proper locations, and click OK.  This should (finally) fix your problem...
>
> Change Program?  Do you mean on the installed program list?
>

I meant exactly what I typed.  On the very screen we were just discussing -
with the list of extensions (.py, .pyc, etc.) there is a button labeled
"Change program..."  Highlight the line for ".py".  Click the button (yes,
the one that says "Change program...").  You'll get another dialog box, and
in that one there will be a button labeled "Browse".  Click it.  This will
open up an "Open with..." dialog box, which will default to the Program
Files folder.  That's probably NOT where your Python install is located -
by default, Python 2.5 would be installed in C:\Python25 - but it's up to
you to figure out where you installed it.  Once you've found it, highlight
python.exe and click the "Open" button.  Click "OK" to get back to the list
of extensions.  Repeat the process for ".pyc", ".pyo", and ".pyw".


>
>
> The uninstall/install should have fixed this, but there are a lot of
> things that could interfere - perhaps you didn't run it as Administrator,
> perhaps it tripped over your previously-modified setting, perhaps the
> installer is buggy, perhaps gremlins are trying to mess with your head...?
>
> Probably the latter. :-)  Well, I may just punt and go to a 64-bit
> install. Maybe up matters by going to 2.6.  I think my 2.5.2 need may have
> disappeared.
>

A 64-bit install will NOT make things any simpler; quite the reverse, in
fact.  .  But upgrading to a newer version is definitely a good idea.  Why
not 2.7, which is current?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20111115/d712a5db/attachment-0001.html>


More information about the Tutor mailing list