Multiple Versions of Python on Windows XP

Colin J. Williams cjw at ncf.ca
Sat Dec 6 08:18:07 EST 2008


Glenn Linderman wrote:
> 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.
> 

Here's another approach to handling 
multiple versions of Python, thanks to the
PyScripter List.  It does not address 
the need to access different versions of
the Python Interpreter.


Here is the full story.

There are two types of Python installation
a)  For all users
   Python creates registry entries at 
HKEY_LOCAL_MACHINE\SOFTWARE\Python
\PythonCore\2.x  with installation info 
and puts the dll in c:\Windows
\System32.
b)  For a single user
   Python creates registry entries at 
HKEY_CURRENT_USER\SOFTWARE\Python
\PythonCore\2.x  with installation info 
and does not put the dll in c:
\Windows\System32.

PyScripter without any command line 
flags looks at the registry to
find the latest version of Python and 
then for an all user
installation tries to load the relevant 
Python dll from the system
path.  For a single user installation 
tries to load the DLL from the
Install path that is in the registry.

When PyScripter is used with a 
--PYTHONxx flag then it does the above
but searching only for the specific version.
The Registry lookup does not take place 
when Python is used with the --
PYTHONDLLPATH.  Instead PyScripter tries 
to load the Python dll from
the specified path.
The --PYTHONDLLPATH flag should be used 
with the --PYTHONxx flag.  See
http://pyscripter.googlepages.com/portablepython 
for an example of
using PyScripter with portable Python.

The %PYTHONHOME% variable is not used by 
PyScripter directly but by
Python to find the installed libraries. 
  See the Python documentation
for its use.

Colin W.



More information about the Python-list mailing list