![]() |
|
|
|||||||
![]() |
Python - Multiple Versions of Python on Windows XP |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Posts: n/a
|
Could anyone please point me to
documentation on the way the msi installer handles multiple versions eg. Python 2.5, 2.6 and 3.0? What changes are made to the registry? Is there some way to specify a default version in such a way that it can be changed as necessary? PyScripter uses an option to select a version eg. C:\Program Files\PyScripter\PyScripter.exe --python26 but I'm having some trouble with it when I attempt edit a python file from the Windows Explorer. I would appreciate any information. Colin W. |
|
|
|
#2 |
|
Posts: n/a
|
> Could anyone please point me to documentation on the way the msi
> installer handles multiple versions eg. Python 2.5, 2.6 and 3.0? I don't think that is documented anywhere. > What changes are made to the registry? For a complete list, see Tools/msi/msi.py in the source tree. > Is there some way to specify a default version in such a way that it can > be changed as necessary? What do you mean by "default version"? There is the version that is associated with the .py/.pyc extensions at any point in time; you can change these by re-running the respective installers from add-and-remove-programs. In a well-managed installation, only one Python installation would have the "Register Extensions" feature selected; to then change the default, one would unselect the feature in one version, and reselect it in a different. If only the default installation procedure was ever used, re-running the installer in "Repair" mode (from ARP) will also restore the extension associations. > PyScripter uses an option to select a version eg. > > C:\Program Files\PyScripter\PyScripter.exe --python26 > > but I'm having some trouble with it when I attempt edit a python file > from the Windows Explorer. It would be good to be more specific with such statements: what troubles specifically? If I play dumb, I'd say "of course - windows explorer doesn't support editing Python files; you need a text editor". Regards, Martin |
|
|
|
#3 |
|
Posts: n/a
|
On approximately 12/1/2008 11:05 PM, came the following characters from
the keyboard of Martin v. Löwis: >> Is there some way to specify a default version in such a way that it can >> be changed as necessary? >> > > What do you mean by "default version"? > > There is the version that is associated with the .py/.pyc extensions > at any point in time; you can change these by re-running the respective > installers from add-and-remove-programs. In a well-managed installation, > only one Python installation would have the "Register Extensions" > feature selected; to then change the default, one would unselect the > feature in one version, and reselect it in a different. If only the > default installation procedure was ever used, re-running the installer > in "Repair" mode (from ARP) will also restore the extension > associations. That seems a lot more cumbersome than just using the command line to change the ftype and assoc a bit. Here's how I set up my computer, for multiple versions. Now to change the "default", I just use the assoc command to change the association for .py to one of the three listed ftypes. Simple and quick. c:\>ftype Python25.File ftype Python25.File Python25.File="C:\Python25\python.exe" "%1" %* c:\>ftype Python26.File ftype Python26.File Python26.File="C:\Python26\python.exe" "%1" %* c:\>ftype Python30.File ftype Python30.File Python30.File="C:\Python30\python.exe" "%1" %* c:\>assoc .py assoc .py ..py=Python25.File It would be nice if the ftypes were version specific as created by the installer; IIRC, I created the above three from the ftype Python.File as I installed each version. -- Glenn -- http://nevcal.com/ =========================== A protocol is complete when there is nothing left to remove. -- Stuart Cheshire, Apple Computer, regarding Zero Configuration Networking |
|
|
|
#4 |
|
Posts: n/a
|
> It would be nice if the ftypes were version specific as created by the
> installer; IIRC, I created the above three from the ftype Python.File as > I installed each version. That's a good idea; please submit a wish list item to bugs.python.org. There may be issues (such as people relying on this being Python.File), but I can't see any problems off-hand. Regards, Martin |
|
|
|
#5 |
|
Posts: n/a
|
On approximately 12/1/2008 11:29 PM, came the following characters from
the keyboard of Martin v. Löwis: >> It would be nice if the ftypes were version specific as created by the >> installer; IIRC, I created the above three from the ftype Python.File as >> I installed each version. >> > > That's a good idea; please submit a wish list item to bugs.python.org. > There may be issues (such as people relying on this being Python.File), > but I can't see any problems off-hand. > > Regards, > Martin > OK, Issue 4485 created. My first one, so let me know if I goofed. I elaborated a bit from the original email, upon reflection. Seemed useful, but also seemed complex by the time I got done. I don't really have a clue what the uninstaller should do with these; nor have I fiddled to know if it presently removes Python.File. I suppose it should delete them, if and only if the ftype and assoc have the same content as was created by the corresponding version installation. -- Glenn -- http://nevcal.com/ =========================== A protocol is complete when there is nothing left to remove. -- Stuart Cheshire, Apple Computer, regarding Zero Configuration Networking |
|
|
|
#6 |
|
Posts: n/a
|
> OK, Issue 4485 created. My first one, so let me know if I goofed. I
> elaborated a bit from the original email, upon reflection. Seemed > useful, but also seemed complex by the time I got done. Looks about right to me. > I don't really have a clue what the uninstaller should do with these; > nor have I fiddled to know if it presently removes Python.File. I > suppose it should delete them, if and only if the ftype and assoc have > the same content as was created by the corresponding version installation. The uninstaller will currently just remove it all. Conditional removal of the associations will be tricky; I'll look into it. I also wonder whether assoc only changes the settings for the current user. In that case, uninstalling a Python version that was per-machine would not affect the user's association, anyway. Regards, Martin |
|
|
|
#7 |
|
Posts: n/a
|
Martin v. Löwis wrote:
>> Could anyone please point me to documentation on the way the msi >> installer handles multiple versions eg. Python 2.5, 2.6 and 3.0? > > I don't think that is documented anywhere. > >> What changes are made to the registry? > > For a complete list, see Tools/msi/msi.py in the source tree. I have scanned the file: http://svn.python.org/projects/pytho...ols/msi/msi.py I don't find anything that addresses this issue. > >> Is there some way to specify a default version in such a way that it can >> be changed as necessary? > > What do you mean by "default version"? I am seeking some mechanism such that any of Python 2.5, Python 2.6 or Python 2.6 can be chosen as the currently active version. > > There is the version that is associated with the .py/.pyc extensions > at any point in time; you can change these by re-running the respective > installers from add-and-remove-programs. In a well-managed installation, > only one Python installation would have the "Register Extensions" > feature selected; to then change the default, one would unselect the > feature in one version, and reselect it in a different. If only the > default installation procedure was ever used, re-running the installer > in "Repair" mode (from ARP) will also restore the extension > associations. I was hoping that there is some simpler way than the "Repair" procedure. > >> PyScripter uses an option to select a version eg. >> >> C:\Program Files\PyScripter\PyScripter.exe --python26 >> >> but I'm having some trouble with it when I attempt edit a python file >> from the Windows Explorer. > > It would be good to be more specific with such statements: what troubles > specifically? If I play dumb, I'd say "of course - windows explorer > doesn't support editing Python files; you need a text editor". Yes, I should have been clearer. The PyScripter application locks up and must be killed, using the Task Manager. Many thanks for your response. Best wishes, Colin W. > > Regards, > Martin |
|
|
|
#8 |
|
Posts: n/a
|
>>> What changes are made to the registry?
>> >> For a complete list, see Tools/msi/msi.py in the source tree. > > I have scanned the file: > http://svn.python.org/projects/pytho...ols/msi/msi.py > > I don't find anything that addresses this issue. Read the add_registry function. You may need to first understand how the Registry table in an MSI file works. > I am seeking some mechanism such that any of Python 2.5, Python 2.6 or > Python 2.6 can be chosen as the currently active version. If Glenn Lindermann's answer doesn't help, you need to explain: what is a "currently active version"? How is one Python version more active than any other? > I was hoping that there is some simpler way than the "Repair" procedure. See Glenn Lindermann's answer. >> It would be good to be more specific with such statements: what troubles >> specifically? If I play dumb, I'd say "of course - windows explorer >> doesn't support editing Python files; you need a text editor". > > Yes, I should have been clearer. The PyScripter application locks up > and must be killed, using the Task Manager. I think you need to report that to the PyScripter authors as a bug. I can't imagine how the "currently active version" can affect what PyScripter does. Regards, Martin |
|
|
|
#9 |
|
Posts: n/a
|
Martin v. Löwis wrote:
>>>> What changes are made to the registry? >>> For a complete list, see Tools/msi/msi.py in the source tree. >> I have scanned the file: >> http://svn.python.org/projects/pytho...ols/msi/msi.py >> >> I don't find anything that addresses this issue. > > Read the add_registry function. You may need to first understand > how the Registry table in an MSI file works. > >> I am seeking some mechanism such that any of Python 2.5, Python 2.6 or >> Python 2.6 can be chosen as the currently active version. > > If Glenn Lindermann's answer doesn't help, you need to explain: > what is a "currently active version"? How is one Python version > more active than any other? > >> I was hoping that there is some simpler way than the "Repair" procedure. > > See Glenn Lindermann's answer. I'll look at it > >>> It would be good to be more specific with such statements: what troubles >>> specifically? If I play dumb, I'd say "of course - windows explorer >>> doesn't support editing Python files; you need a text editor". Using a right click, one can open any ..py file with say SciTe. Within SciTe, one can Run the current file. It would be good to have the appropriate version (my use of "default") preselected. >> Yes, I should have been clearer. The PyScripter application locks up >> and must be killed, using the Task Manager. > > I think you need to report that to the PyScripter authors as a bug. > I can't imagine how the "currently active version" can affect what > PyScripter does. Yes, I'll do that. > I'll also follow up with Glenn Lindermann's answer. Many thanks, Best wishes, Colin W. > Regards, > Martin |
|
|
|
#10 |
|
Posts: n/a
|
> Using a right click, one can open any .py file with say SciTe. Within
> SciTe, one can Run the current file. > > It would be good to have the appropriate version (my use of "default") > preselected. I don't know how SciTe choses the version of Python to run. In the sense in why you use the word, there might just not be a "default" version of Python on Windows. Somebody who knows SciTe better may correct me. Regards, Martin |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to activate Remote Assistance with XP using Windows Live Messenger | Oziisr | General Help Related Topics | 0 | 02-01-2008 03:45 PM |
| Computer Security | aldrich.chappel.com.use@gmail.com | A+ Certification | 0 | 11-27-2007 01:11 AM |
| MCITP: Enterprise Support Technician | MileHighWelch | MCITP | 1 | 06-19-2007 09:25 PM |
| Re: Question about MS critical updates | John Coode | A+ Certification | 0 | 06-30-2004 05:08 PM |