I'm looking for tips on installing and running Python version 2.6 and version 3.0 together on same Windows machine.
I'd like to install both 2.6 and 3.0 together on the same Windows (Vista) machine, so I can test programs under both versions.
Is it possible to install both versions on the same Windows machine in such a way that they are both asily available and don't interfere with one another? I'm concerned, for example, that if I install both, the second installation will over-write some Python entry in the registry.
I'd like something fairly simple -- I will be sharing this information with others in my workgroup for whom virtualenv is not an option.
I googled around, but couldn't find anything that seemed to address this specific question. If anybody knows of a URL with this information (a "2 to 3 Conversion FAQs"?) that would be great.
steve.ferg.bitbuc...@gmail.com wrote: > I'm looking for tips on installing and running Python version 2.6 and > version 3.0 together on same Windows machine.
> I'd like to install both 2.6 and 3.0 together on the same Windows > (Vista) machine, so I can test programs under both versions.
> Is it possible to install both versions on the same Windows machine in > such a way that they are both asily available and don't interfere with > one another? I'm concerned, for example, that if I install both, the > second installation will over-write some Python entry in the registry.
> I'd like something fairly simple -- I will be sharing this information > with others in my workgroup for whom virtualenv is not an option.
> I googled around, but couldn't find anything that seemed to address > this specific question. If anybody knows of a URL with this > information (a "2 to 3 Conversion FAQs"?) that would be great.
> Any help would be greatly appreciated.
It's easy - the registry isn't used except to associate files. The associations are made with the most-recently-installed version.
I currently have 2.4, 2.5, 2.6 and 3.0 on my Windows machine.
regards Steve -- Steve Holden +1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/
> It's easy - the registry isn't used except to associate files. The > associations are made with the most-recently-installed version.
> I currently have 2.4, 2.5, 2.6 and 3.0 on my Windows machine.
In addition, at install time, there is the choice of not creating associations (i.e. links what interpreter should be invoked if you double-click a .py file, and what version of IDLE should start when you select Edit from the context menu).
So if you install 2.6 first, then 3.0, but deselect the installation of associations, 2.6 will continue to be associated with the .py, .pyw, and .pyc extensions.
> > It's easy - the registry isn't used except to associate files. The > > associations are made with the most-recently-installed version.
> > I currently have 2.4, 2.5, 2.6 and 3.0 on my Windows machine.
> In addition, at install time, there is the choice of not creating > associations (i.e. links what interpreter should be invoked if you > double-click a .py file, and what version of IDLE should start > when you select Edit from the context menu).
> So if you install 2.6 first, then 3.0, but deselect the installation > of associations, 2.6 will continue to be associated with the > .py, .pyw, and .pyc extensions.
> Regards, > Martin
Technically not true. Python DOES use the registry, but it's per- version and isolated from each other. Each installs some configuration data in HKEY_LOCAL_MACHINE\\Software\Python\PythonCore\MAJOR.MINOR, so you'll have stuff in HKLM\\Software\Python\PythonCore\2.6 and HKLM\ \Software\Python\PythonCore\3.0. And yes, this DOES mean you can't have 2.6 and 2.6.1 cleanly installed on the machine at the same time.
As long as you keep your .py and .pyw files associated with the preferred Python interpreter (2.6 I'm assuming) and EXPLICTLY call C: \Python30\Python.exe when you want to run on 3.0, you're golden.
In general, there are several options in maintaining separate environments:
1) Create a separate user for each environment. This allows you to keep things such as Path and file associations so that you are selecting a certain install whenever you are logged in as that user. This may NOT be an option on Vista though. The Python installer will tell you whether you can install for only the current user.
2) Use batch scripts to setup your PATH and PYTHONPATH. This will not solve the file association problem, but you can probably set up your "SEND TO" folder to handle the different versions.
3) Use something like virtualenv.
I'm using option 2).
A couple more hints: if you are using a windows installer for a third- party lib, (like wxpython), the installer will look in the registry for a matching python installation. If there isn't one, it shouldn't be a problem, just install it where it needs to go. (in the appropriate Python folder).
You can also use the repair option for the python installer to get the registry set up for a particular install. For example, if you installed Python 3, but want to then use associations with 2.6, just use repair with the 2.6 installer. (Not sure what else repair does though)
Finally, you can use the --prefix option to setup.py to get installs to go where you want on win.